This commit is contained in:
@@ -14,9 +14,21 @@ TODO CLIENT STUFF
|
|||||||
|
|
||||||
TODO NEXT
|
TODO NEXT
|
||||||
|
|
||||||
ADHD planning for this stuff: break into small actionable chunks then do it
|
|
||||||
|
|
||||||
Find out how to do a currency and other types of numeric input
|
Find out how to do a currency and other types of numeric input
|
||||||
|
Make the currency and numeric fields work, then do the next stuff below:
|
||||||
|
|
||||||
|
Currency field can be a v-text field with
|
||||||
|
Prefix set to the currency symbol and v-validate to ensure it's entered correctly
|
||||||
|
You can use the object form:
|
||||||
|
v-validate="{ required: true, decimal: [2, ','] }"
|
||||||
|
|
||||||
|
https://github.com/baianat/vee-validate/commit/d9a3e97846aa47074e11bda4499ad539807ef0aa#commitcomment-25381793
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Figure out why custom fields don't exist in widgets test data and put it there so can code it.
|
Figure out why custom fields don't exist in widgets test data and put it there so can code it.
|
||||||
Put all the widget fields on the form
|
Put all the widget fields on the form
|
||||||
Check rights when navigating to the form
|
Check rights when navigating to the form
|
||||||
|
|||||||
@@ -39,14 +39,26 @@
|
|||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="obj.dollarAmount"
|
v-model="obj.dollarAmount"
|
||||||
v-validate="'required|email'"
|
:prefix="locale.currencySymbol"
|
||||||
:error-messages="errors.collect('email')"
|
v-validate="{ required: true, decimal: [2, ','] }"
|
||||||
label="E-mail"
|
:error-messages="errors.collect('dollarAmount')"
|
||||||
data-vv-name="email"
|
label="Dollar amount"
|
||||||
|
data-vv-name="dollarAmount"
|
||||||
required
|
required
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-flex>
|
</v-flex>
|
||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
|
<v-text-field
|
||||||
|
v-model="obj.dollarAmount2"
|
||||||
|
:prefix="localeCurrencySymbol()"
|
||||||
|
:v-validate="{ required: true, decimal: [2, localeDecimalSeparator()] }"
|
||||||
|
:error-messages="errors.collect('dollarAmount2')"
|
||||||
|
label="Dollar amount2"
|
||||||
|
data-vv-name="dollarAmount2"
|
||||||
|
required
|
||||||
|
></v-text-field>
|
||||||
|
</v-flex>
|
||||||
|
<!-- <v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-select
|
<v-select
|
||||||
v-model="select"
|
v-model="select"
|
||||||
v-validate="'required'"
|
v-validate="'required'"
|
||||||
@@ -56,7 +68,7 @@
|
|||||||
data-vv-name="select"
|
data-vv-name="select"
|
||||||
required
|
required
|
||||||
></v-select>
|
></v-select>
|
||||||
</v-flex>
|
</v-flex> -->
|
||||||
<v-flex xs12 sm6 lg4 xl3 px-2>
|
<v-flex xs12 sm6 lg4 xl3 px-2>
|
||||||
<v-checkbox
|
<v-checkbox
|
||||||
v-model="obj.active"
|
v-model="obj.active"
|
||||||
@@ -99,6 +111,7 @@ export default {
|
|||||||
name: "Fantastic Wooden Chips 122",
|
name: "Fantastic Wooden Chips 122",
|
||||||
serial: 100,
|
serial: 100,
|
||||||
dollarAmount: 584.83,
|
dollarAmount: 584.83,
|
||||||
|
dollarAmount2: 123.56,
|
||||||
active: true,
|
active: true,
|
||||||
roles: 8212,
|
roles: 8212,
|
||||||
startDate: "2019-02-12T10:12:39.594206",
|
startDate: "2019-02-12T10:12:39.594206",
|
||||||
@@ -108,7 +121,12 @@ export default {
|
|||||||
count: 10,
|
count: 10,
|
||||||
customFields: null,
|
customFields: null,
|
||||||
tags: ["brown", "red"]
|
tags: ["brown", "red"]
|
||||||
|
},
|
||||||
|
locale:{
|
||||||
|
currencySymbol: "CAD",
|
||||||
|
decimalSeparator: "*"
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
beforeRouteEnter(to, from, next) {
|
beforeRouteEnter(to, from, next) {
|
||||||
@@ -150,7 +168,21 @@ export default {
|
|||||||
return lt.get(key);
|
return lt.get(key);
|
||||||
},
|
},
|
||||||
submit() {
|
submit() {
|
||||||
|
//alert("VALIDATING>>>");
|
||||||
|
console.log(obj.dollarAmount2);
|
||||||
|
alert(obj.dollarAmount2);
|
||||||
this.$validator.validateAll();
|
this.$validator.validateAll();
|
||||||
|
|
||||||
|
},
|
||||||
|
localeDecimalSeparator(){
|
||||||
|
return ',';
|
||||||
|
},
|
||||||
|
localeCurrencySymbol(){
|
||||||
|
return 'Eur';
|
||||||
|
},
|
||||||
|
clear(){
|
||||||
|
console.log(this.data().obj.dollarAmount2);
|
||||||
|
alert(data().obj.dollarAmount2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user