option for output-only
Closed this issue · 4 comments
GitzJoey commented
i think its a great features to implement some kind output-only
not only for the input text by using autoNumeric.format()
AlexandreBonneau commented
You mean by passing a custom tag (ie. 'p') and the readOnly option?
GitzJoey commented
let say we only need to show the value but already formatted
something like
<p><vue-autonumeric v-model="somenumber"></vue-autonumeric></p>and we see already formatted according to the config (eg $ 123.00 where somenumber = 123 inside span tag)
cannot use arrow (i dunno why)
AlexandreBonneau commented
I fixed your comment to use the correct html notation
I'm still not sure exactly what you want, but from what I understood, it seems you can achieve the 'display only a non-interactive formatted value' just by either:
- using vue-autoNumeric with the
:tag="'p'"prop and the:options="{ readOnly: true, noEventListeners: true }" - just create a custom component and just use
mounted() { this.value = AutoNumeric.format(val, options); }
GitzJoey commented
ahh yes....that's perfect. case closed.