naive-ui/demo/documentation/components/select/zhCN/change-debug.demo.md
2020-10-01 01:53:57 +08:00

600 B

Change Debug

<n-select
  v-model:value="node"
  :options="[{label: 'a', value: 'a'},{label: 'b', value: 'b'},{label: 'c', value: 'c'}]"
  clearable
  filterable
  :disabled="!editable"
  placeholder="Please Select"
  multiple
  @update:value="nodeChange"
/>
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)
    }
  }
}