This commit is contained in:
2019-02-26 00:53:06 +00:00
parent 49dabba5fa
commit b70945607e
2 changed files with 51 additions and 7 deletions

View File

@@ -14,9 +14,21 @@ TODO CLIENT STUFF
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
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.
Put all the widget fields on the form
Check rights when navigating to the form

View File

@@ -39,14 +39,26 @@
<v-flex xs12 sm6 lg4 xl3 px-2>
<v-text-field
v-model="obj.dollarAmount"
v-validate="'required|email'"
:error-messages="errors.collect('email')"
label="E-mail"
data-vv-name="email"
:prefix="locale.currencySymbol"
v-validate="{ required: true, decimal: [2, ','] }"
:error-messages="errors.collect('dollarAmount')"
label="Dollar amount"
data-vv-name="dollarAmount"
required
></v-text-field>
</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-model="select"
v-validate="'required'"
@@ -56,7 +68,7 @@
data-vv-name="select"
required
></v-select>
</v-flex>
</v-flex> -->
<v-flex xs12 sm6 lg4 xl3 px-2>
<v-checkbox
v-model="obj.active"
@@ -99,6 +111,7 @@ export default {
name: "Fantastic Wooden Chips 122",
serial: 100,
dollarAmount: 584.83,
dollarAmount2: 123.56,
active: true,
roles: 8212,
startDate: "2019-02-12T10:12:39.594206",
@@ -108,7 +121,12 @@ export default {
count: 10,
customFields: null,
tags: ["brown", "red"]
},
locale:{
currencySymbol: "CAD",
decimalSeparator: "*"
}
};
},
beforeRouteEnter(to, from, next) {
@@ -150,7 +168,21 @@ export default {
return lt.get(key);
},
submit() {
//alert("VALIDATING>>>");
console.log(obj.dollarAmount2);
alert(obj.dollarAmount2);
this.$validator.validateAll();
},
localeDecimalSeparator(){
return ',';
},
localeCurrencySymbol(){
return 'Eur';
},
clear(){
console.log(this.data().obj.dollarAmount2);
alert(data().obj.dollarAmount2);
}
}
};