naive-ui/demo/documentation/components/input-number/enUS/event.demo.md
2020-12-12 15:33:41 +08:00

406 B

Event

Blur & change events are exposed.

<n-input-number
  v-model:value="value"
  @update:value="handleChange"
  @blur="handleBlur"
/>
export default {
  inject: ['message'],
  data () {
    return {
      value: 0
    }
  },
  methods: {
    handleChange (v) {
      this.message.info(`value: ${v}`)
    },
    handleBlur (v) {
      this.message.info('blur: ' + v)
    }
  }
}