naive-ui/demo/documentation/components/input/enUS/event.demo.md
07akioni 487001d697 build: add changelog to site, refactor loader based on suffix
.demo.md for component demo
.demo-entry.md for demo entry
.md for common docs
2020-08-19 23:30:04 +08:00

54 lines
935 B
Markdown

# Event
```html
<n-input
v-model="value"
@blur="handleBlur"
@focus="handleFocus"
@change="handleChange"
@keyup="handleKeyUp"
@input="handleInput"
placeholder="Operate to trigger events"
/>
<n-input
v-model="value"
type="textarea"
@blur="handleBlur"
@focus="handleFocus"
@change="handleChange"
@keyup="handleKeyUp"
@input="handleInput"
placeholder="Operate to trigger events"
/>
```
```js
export default {
data() {
return {
value: null,
pair: null
}
},
methods: {
handleFocus() {
this.$NMessage.info("[Event focus]")
},
handleBlur() {
this.$NMessage.info("[Event blur]")
},
handleChange(v) {
this.$NMessage.info("[Event change]" + v)
},
handleKeyUp(e) {
this.$NMessage.info("[Event keyup]")
},
handleInput(v) {
this.$NMessage.info("[Event input] " + v)
}
}
}
```
```css
.n-input {
margin-bottom: 8px;
}
```