autoNumeric/vue-autoNumeric

option for output-only

Closed this issue · 4 comments

i think its a great features to implement some kind output-only
not only for the input text by using autoNumeric.format()

You mean by passing a custom tag (ie. 'p') and the readOnly option?

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)

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); }

ahh yes....that's perfect. case closed.