v-model modifier

1) .lazy: replace the monitor input change event.

usage:

  v-model.lazy="message"

effect:

  When changing the input data input box, DOM v-model binding data temporarily does not change, when the input loses focus, the data change

2) .number: input string into digital.

usage:

  v-model.number="message"

effect:

  Start typing in the input box enter a number, then enter non-numeric, non-numeric data will show only the digital input will not be displayed. But if the first non-numeric input, then enter a number, then this modifier failure

3) .trim: removing the input and trailing spaces.

usage:

  v-model.trim="message"

effect:

  When the input frame is changed input data, if the input data is end to end with a space, then this modifier will automatically remove head and tail modifier. This modifier but will not get rid of the middle of the box!

Guess you like

Origin www.cnblogs.com/jmwlhj/p/11041879.html
Recommended