Blame view

test/routers/radio.vue 6.71 KB
7fa943eb   梁灏   init
1
2
  <template>
      <div>
122e69ee   梁灏   update Transfer
3
          <Checkbox>hello</Checkbox>
7d7221ec   梁灏   optimize Radio si...
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
          <Radio-group :model.sync="phone">
              <Radio value="apple">
                  <Icon type="social-apple"></Icon>
                  <span>Apple</span>
              </Radio>
              <Radio value="android" disabled>
                  <Icon type="social-android"></Icon>
                  <span>Android</span>
              </Radio>
              <Radio value="windows">
                  <Icon type="social-windows"></Icon>
                  <span>Windows</span>
              </Radio>
          </Radio-group>
          <Radio-group :model.sync="animal">
              <Radio value="金斑蝶"></Radio>
              <Radio value="爪哇犀牛"></Radio>
              <Radio value="印度黑羚"></Radio>
          </Radio-group>
          <br><br>
e1134de2   jingsam   not bundle vue in...
24
          <i-button @click="activeKey = '2'">换</i-button>
7fa943eb   梁灏   init
25
      </div>
4925f85f   梁灏   add Radio UI
26
      <Radio :checked.sync="radio">Radio</Radio>
e1134de2   jingsam   not bundle vue in...
27
      <i-button @click="radio = !radio">change radio</i-button>
4925f85f   梁灏   add Radio UI
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
      <br>
      <br>
      <Radio-group :model.sync="phone" type="button">
          <Radio value="apple">
              <Icon type="social-apple"></Icon>
              <span>Apple</span>
          </Radio>
          <Radio value="android">
              <Icon type="social-android"></Icon>
              <span>Android</span>
          </Radio>
          <Radio value="windows">
              <Icon type="social-windows"></Icon>
              <span>Windows</span>
          </Radio>
      </Radio-group>
      <Radio-group :model.sync="animal" type="button">
          <Radio value="金斑蝶"></Radio>
          <Radio value="爪哇犀牛"></Radio>
          <Radio value="印度黑羚"></Radio>
      </Radio-group>
  
      <Radio-group :model.sync="animal" type="button">
          <Radio value="金斑蝶" disabled></Radio>
          <Radio value="爪哇犀牛" disabled></Radio>
          <Radio value="印度黑羚"></Radio>
      </Radio-group>
      <br><br>
      <Radio-group :model.sync="animal" type="button" size="large">
          <Radio value="金斑蝶"></Radio>
          <Radio value="爪哇犀牛"></Radio>
          <Radio value="印度黑羚"></Radio>
      </Radio-group>
      <Radio-group :model.sync="animal" type="button">
          <Radio value="金斑蝶"></Radio>
          <Radio value="爪哇犀牛"></Radio>
          <Radio value="印度黑羚"></Radio>
      </Radio-group>
      <Radio-group :model.sync="animal" type="button" size="small">
          <Radio value="金斑蝶"></Radio>
          <Radio value="爪哇犀牛"></Radio>
          <Radio value="印度黑羚"></Radio>
      </Radio-group>
6c5fbd8b   梁灏   add Checkbox UI
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
      <br><br><br><br>
      <Checkbox :checked.sync="radio">Checkbox</Checkbox>
      <br><br>
      <Checkbox-group :model="social">
          <Checkbox value="twitter">
              <Icon type="social-twitter"></Icon>
              <span>Twitter</span>
          </Checkbox>
          <Checkbox value="facebook">
              <Icon type="social-facebook"></Icon>
              <span>Facebook</span>
          </Checkbox>
          <Checkbox value="github">
              <Icon type="social-github"></Icon>
              <span>Github</span>
          </Checkbox>
          <Checkbox value="snapchat">
              <Icon type="social-snapchat"></Icon>
              <span>Snapchat</span>
          </Checkbox>
      </Checkbox-group>
      <br><br>
      <Checkbox :checked.sync="disabledSingle" disabled>Checkbox</Checkbox>
      <Checkbox-group :model="disabledGroup">
          <Checkbox value="香蕉" disabled></Checkbox>
          <Checkbox value="苹果" disabled></Checkbox>
          <Checkbox value="西瓜"></Checkbox>
      </Checkbox-group>
07aa688e   梁灏   add Switch UI
99
100
101
102
103
104
105
106
107
108
109
110
111
112
      <br><br>
      <Switch @on-change="change"></Switch>
      <br><br>
      <Switch>
          <span slot="open">开</span>
          <span slot="close">关</span>
      </Switch>
      <br><br>
      <Switch>
          <Icon type="android-done" slot="open"></Icon>
          <Icon type="android-close" slot="close"></Icon>
      </Switch>
      <Switch disabled></Switch>
      <Switch size="small"></Switch>
95436eeb   梁灏   add InputNumber UI
113
114
115
116
117
      <br><br>
      <Input-number :max="10" :min="1" :step="1.2" :value="1"></Input-number>
      <Input-number :value="2" size="small"></Input-number>
      <Input-number :value="2"></Input-number>
      <Input-number :value="2" size="large"></Input-number>
a86e42c0   梁灏   add Breadcrumb UI
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
      <br><br>
      <Breadcrumb>
          <Breadcrumb-item href="/">Home</Breadcrumb-item>
          <Breadcrumb-item href="/components/breadcrumb">Components</Breadcrumb-item>
          <Breadcrumb-item>Breadcrumb</Breadcrumb-item>
      </Breadcrumb>
      <Breadcrumb>
          <Breadcrumb-item href="/">
              <Icon type="ios-home-outline"></Icon> Home
          </Breadcrumb-item>
          <Breadcrumb-item href="/components/breadcrumb">
              <Icon type="social-buffer-outline"></Icon> Components
          </Breadcrumb-item>
          <Breadcrumb-item>
              <Icon type="pound"></Icon> Breadcrumb
          </Breadcrumb-item>
      </Breadcrumb>
      <Breadcrumb separator=">">
          <Breadcrumb-item href="/">Home</Breadcrumb-item>
          <Breadcrumb-item href="/components/breadcrumb">Components</Breadcrumb-item>
          <Breadcrumb-item>Breadcrumb</Breadcrumb-item>
      </Breadcrumb>
      <Breadcrumb separator="<b class='demo-breadcrumb-separator'>=></b>">
          <Breadcrumb-item href="/">Home</Breadcrumb-item>
          <Breadcrumb-item href="/components/breadcrumb">Components</Breadcrumb-item>
          <Breadcrumb-item>Breadcrumb</Breadcrumb-item>
      </Breadcrumb>
71699f6b   梁灏   optimize Checkbox...
145
146
      <br><br>
      <Checkbox :checked.sync="single"></Checkbox>
7fa943eb   梁灏   init
147
148
  </template>
  <script>
e1134de2   jingsam   not bundle vue in...
149
      import { Radio, Alert, Icon, Collapse, iButton, Checkbox, Switch, InputNumber, Breadcrumb, LoadingBar } from 'iview';
7fa943eb   梁灏   init
150
151
  
      const RadioGroup = Radio.Group;
49306c7a   梁灏   add Collapse comp...
152
      const Panel = Collapse.Panel;
6c5fbd8b   梁灏   add Checkbox UI
153
      const CheckboxGroup = Checkbox.Group;
a86e42c0   梁灏   add Breadcrumb UI
154
      const BreadcrumbItem = Breadcrumb.Item;
7fa943eb   梁灏   init
155
156
157
158
  
      export default {
          components: {
              Radio,
9d69bab6   梁灏   add Alert component
159
160
              RadioGroup,
              Alert,
49306c7a   梁灏   add Collapse comp...
161
162
163
              Icon,
              Collapse,
              Panel,
e1134de2   jingsam   not bundle vue in...
164
              iButton,
6c5fbd8b   梁灏   add Checkbox UI
165
              Checkbox,
07aa688e   梁灏   add Switch UI
166
              CheckboxGroup,
95436eeb   梁灏   add InputNumber UI
167
              Switch,
a86e42c0   梁灏   add Breadcrumb UI
168
169
              InputNumber,
              Breadcrumb,
9dde24b6   梁灏   add LoadingBar co...
170
171
              BreadcrumbItem,
              LoadingBar
7fa943eb   梁灏   init
172
173
          },
          props: {
7d7221ec   梁灏   optimize Radio si...
174
  
7fa943eb   梁灏   init
175
176
177
          },
          data () {
              return {
71699f6b   梁灏   optimize Checkbox...
178
                  single: false,
4925f85f   梁灏   add Radio UI
179
                  radio: false,
49306c7a   梁灏   add Collapse comp...
180
                  radioGroup: '段模',
4925f85f   梁灏   add Radio UI
181
182
                  activeKey: [1,2],
                  phone: 'apple',
6c5fbd8b   梁灏   add Checkbox UI
183
184
185
186
                  animal: '爪哇犀牛',
                  social: ['facebook', 'github'],
                  disabledSingle: true,
                  disabledGroup: ['苹果']
7fa943eb   梁灏   init
187
188
189
              }
          },
          computed: {
7d7221ec   梁灏   optimize Radio si...
190
  
7fa943eb   梁灏   init
191
192
193
194
          },
          methods: {
              changeGroup (data) {
                  console.log(data);
9d69bab6   梁灏   add Alert component
195
196
197
              },
              closed (data) {
                  console.log(data)
07aa688e   梁灏   add Switch UI
198
199
200
              },
              change (status) {
                  console.log(status);
7fa943eb   梁灏   init
201
              }
9dde24b6   梁灏   add LoadingBar co...
202
203
204
          },
          ready () {
              LoadingBar.start();
7fa943eb   梁灏   init
205
206
          }
      }
e1134de2   jingsam   not bundle vue in...
207
  </script>