naive-ui/demo/documentation/components/switch/enUS/event.demo.md
2020-12-12 15:33:41 +08:00

295 B

Event

<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}`)
    }
  }
}