mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-01-12 12:25:16 +08:00
34 lines
588 B
Markdown
34 lines
588 B
Markdown
|
# Change Debug
|
||
|
```html
|
||
|
<n-select
|
||
|
v-model="node"
|
||
|
:options="[{label: 'a', value: 'a'},{label: 'b', value: 'b'},{label: 'c', value: 'c'}]"
|
||
|
clearable
|
||
|
filterable
|
||
|
:disabled="!editable"
|
||
|
placeholder="Please Select"
|
||
|
multiple
|
||
|
@change="nodeChange"
|
||
|
/>
|
||
|
```
|
||
|
|
||
|
```js
|
||
|
export default {
|
||
|
data () {
|
||
|
return {
|
||
|
node: null,
|
||
|
editable: true
|
||
|
}
|
||
|
},
|
||
|
watch: {
|
||
|
node (newValue, oldValue) {
|
||
|
console.log('watch node', newValue === oldValue, newValue, oldValue)
|
||
|
}
|
||
|
},
|
||
|
methods: {
|
||
|
nodeChange (value) {
|
||
|
console.log('handle node change', value)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
```
|