Blame view

examples/routers/switch.vue 1.39 KB
2af5843d   梁灏   Switch add large ...
1
  <template>
2d5ba278   梁灏   support Switch
2
      <div>
1f41c9ca   梁灏   fixed #1797
3
          <i-switch v-model="m1" true-value="yes" false-value="no">
2d5ba278   梁灏   support Switch
4
5
6
7
              <span slot="open">开</span>
              <span slot="close">关</span>
          </i-switch>
          {{ m1 }}
1f41c9ca   梁灏   fixed #1797
8
          <div @click="m1 = 'no'">toggle</div>
ac2f8493   梁灏   update Switch style
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
          <br><br>
          <i-switch size="large"></i-switch>
          <i-switch></i-switch>
          <i-switch size="small"></i-switch>
          <br><br>
          <i-switch>
              <span slot="open">开</span>
              <span slot="close">关</span>
          </i-switch>
          <i-switch>
              <Icon type="android-done" slot="open"></Icon>
              <Icon type="android-close" slot="close"></Icon>
          </i-switch>
          <br><br>
          <i-switch size="large">
              <span slot="open">开启</span>
              <span slot="close">关闭</span>
          </i-switch>
          <i-switch size="large">
              <span slot="open">ON</span>
              <span slot="close">OFF</span>
          </i-switch>
          <br><br>
          <i-switch :disabled="disabled"></i-switch>
          <Button type="primary" @click="disabled = !disabled">Toggle Disabled</Button>
2d5ba278   梁灏   support Switch
34
      </div>
2af5843d   梁灏   Switch add large ...
35
36
  </template>
  <script>
2af5843d   梁灏   Switch add large ...
37
      export default {
2af5843d   梁灏   Switch add large ...
38
39
          data () {
              return {
ac2f8493   梁灏   update Switch style
40
41
                  m1: 'yes',
                  disabled: true
2af5843d   梁灏   Switch add large ...
42
43
44
45
              }
          },
          methods: {
              change (status) {
2d5ba278   梁灏   support Switch
46
                  console.log(status)
2af5843d   梁灏   Switch add large ...
47
48
49
50
              }
          }
      }
  </script>