naive-ui/demo/documentation/components/switch/zhCN/event.demo.md
2020-10-22 13:10:54 +08:00

297 B

事件

<n-switch
  v-model:value="active"
  @update:value="handleChange"
/>
export default {
  inject: ['message'],
  data () {
    return {
      active: false
    }
  },
  methods: {
    handleChange (value) {
      this.message.info(`Update value: ${value}`)
    }
  }
}