ant-design-vue/components/switch/demo/basic.md

389 B

#### 基本用法 最简单的用法。 #### basic Usage The most basic usage.
<template>
  <div>
    <a-switch defaultChecked @change="onChange" />
  </div>
</template>
<script>
  export default {
    data() {
      return {};
    },
    methods: {
      onChange(checked) {
        console.log(`a-switch to ${checked}`);
      },
    },
  };
</script>