naive-ui/demo/documentation/components/inputNumber/enUS/event.md

27 lines
373 B
Markdown
Raw Normal View History

2019-10-22 14:27:25 +08:00
# Event
2020-01-29 16:14:59 +08:00
Blur & change events are exposed.
2019-10-22 14:27:25 +08:00
```html
<n-input-number
v-model="value"
@change="handleChange"
2019-10-30 18:10:11 +08:00
@blur="handleBlur"
2019-10-22 14:27:25 +08:00
/>
```
```js
export default {
data () {
return {
value: 0
}
},
methods: {
2020-01-29 16:14:59 +08:00
handleChange (v) {
this.$NMessage.info(`value: ${v}`)
2019-10-30 18:10:11 +08:00
},
2020-01-29 16:14:59 +08:00
handleBlur (v) {
2019-10-30 18:10:11 +08:00
this.$NMessage.info(`blur: ` + v)
},
2019-10-22 14:27:25 +08:00
}
}
```