Blame view

test/routers/switch.vue 970 Bytes
2af5843d   梁灏   Switch add large ...
1
2
3
4
5
6
7
8
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
34
  <template>
      <Switch @on-change="change"></Switch>
      <Switch>
          <span slot="open">开</span>
          <span slot="close">关</span>
      </Switch>
      <Switch size="large">
          <span slot="open">ON</span>
          <span slot="close">OFF</span>
      </Switch>
      <Switch>
          <Icon type="android-done" slot="open"></Icon>
          <Icon type="android-close" slot="close"></Icon>
      </Switch>
      <Switch :disabled="disabled"></Switch>
      <i-button type="primary" @click="disabled = !disabled">Toggle Disabled</i-button>
      <Switch size="small"></Switch>
  </template>
  <script>
      import { Switch, Message, iButton, Icon } from 'iview';
      export default {
          components: { Switch, Message, iButton, Icon },
          data () {
              return {
                  disabled: true
              }
          },
          methods: {
              change (status) {
                  Message.info('开关状态:' + status);
              }
          }
      }
  </script>