I have a form, on which I am trying to use Vue's "currency" filter on certain inputs that are then validated using Vue Validator (https://github.com/vuejs/vue-validator).
HTML
<validator name="foo">
<input id="example" type="tel" v-model="baz | currency" v-validate:bar="['required']" />...
<span> equals {{ baz }}</span>...
</validator>
JavaScript
Vue.config.warnExpressionErrors = false;
var vm = new Vue({
el: '#demo',
data: {
baz: ''
}
});
The filtered and validated fields update with every keystroke — such that they are cleared/reset each time. The effect is that attempting to key in a number, such as 1234, will result in the <input>
showing "$3.004" or "$4.00" (though you may see: "$1.00" "$1.002" "$2.00" "$2.003" or "$3.00" as you type).
I'm thinking there's a conflict between the filter and the component for which gets the final say over the value(?)
There's a very good possibility that I'm not implementing this correctly. I distilled the issue down to the salient components int he following JSFiddle…