Commit 47dc36c58b4d40304ca8ebaa6ba191cace54a052
1 parent
b45a0e68
fixed Cascader style error
Showing
2 changed files
with
16 additions
and
22 deletions
Show diff stats
examples/routers/cascader.vue
1 | 1 | <template> |
2 | - <div style="margin: 100px;width: 300px;"> | |
3 | - <Cascader v-model="value" :data="data" change-on-select></Cascader> | |
4 | - </div> | |
2 | + <Cascader v-model="value3" :data="data" filterable style="width: 400px"></Cascader> | |
5 | 3 | </template> |
6 | 4 | <script> |
7 | 5 | export default { |
8 | 6 | data () { |
9 | 7 | return { |
10 | - value: ['beijing', 'gugong'], | |
11 | - data: [] | |
12 | - } | |
13 | - }, | |
14 | - mounted () { | |
15 | - setTimeout(() => { | |
16 | - this.data = [{ | |
17 | - value: 'beijing', | |
8 | + data: [{ | |
9 | + value: 1, | |
18 | 10 | label: '北京', |
19 | 11 | children: [ |
20 | 12 | { |
21 | - value: 'gugong', | |
13 | + value: 11, | |
22 | 14 | label: '故宫' |
23 | 15 | }, |
24 | 16 | { |
25 | - value: 'tiantan', | |
17 | + value: 12, | |
26 | 18 | label: '天坛' |
27 | 19 | }, |
28 | 20 | { |
29 | - value: 'wangfujing', | |
21 | + value: 13, | |
30 | 22 | label: '王府井' |
31 | 23 | } |
32 | 24 | ] |
33 | 25 | }, { |
34 | - value: 'jiangsu', | |
26 | + value: 2, | |
35 | 27 | label: '江苏', |
36 | 28 | children: [ |
37 | 29 | { |
38 | - value: 'nanjing', | |
30 | + value: 21, | |
39 | 31 | label: '南京', |
40 | 32 | children: [ |
41 | 33 | { |
42 | - value: 'fuzimiao', | |
34 | + value: 211, | |
43 | 35 | label: '夫子庙', |
44 | 36 | } |
45 | 37 | ] |
46 | 38 | }, |
47 | 39 | { |
48 | - value: 'suzhou', | |
40 | + value: 22, | |
49 | 41 | label: '苏州', |
50 | 42 | children: [ |
51 | 43 | { |
52 | - value: 'zhuozhengyuan', | |
44 | + value: 221, | |
53 | 45 | label: '拙政园', |
54 | 46 | }, |
55 | 47 | { |
56 | - value: 'shizilin', | |
48 | + value: 222, | |
57 | 49 | label: '狮子林', |
58 | 50 | } |
59 | 51 | ] |
60 | 52 | } |
61 | 53 | ], |
62 | - }]; | |
63 | - }, 100) | |
54 | + }], | |
55 | + value3: [] | |
56 | + } | |
64 | 57 | } |
65 | 58 | } |
66 | 59 | </script> | ... | ... |