Commit 48af13599c9ab5e1cb21f3342e87793b5a173f35
1 parent
361e3a16
fixed #553
Showing
2 changed files
with
54 additions
and
48 deletions
Show diff stats
examples/routers/cascader.vue
| ... | ... | @@ -79,60 +79,63 @@ |
| 79 | 79 | export default { |
| 80 | 80 | data () { |
| 81 | 81 | return { |
| 82 | - value2: [], | |
| 83 | - data: [{ | |
| 84 | - value: 'beijing', | |
| 85 | - label: '北京', | |
| 86 | - children: [ | |
| 87 | - { | |
| 88 | - value: 'gugong', | |
| 89 | - label: '故宫' | |
| 90 | - }, | |
| 91 | - { | |
| 92 | - value: 'tiantan', | |
| 93 | - label: '天坛' | |
| 94 | - }, | |
| 95 | - { | |
| 96 | - value: 'wangfujing', | |
| 97 | - label: '王府井' | |
| 98 | - } | |
| 99 | - ] | |
| 100 | - }, { | |
| 101 | - value: 'jiangsu', | |
| 102 | - label: '江苏', | |
| 103 | - children: [ | |
| 104 | - { | |
| 105 | - value: 'nanjing', | |
| 106 | - label: '南京', | |
| 107 | - children: [ | |
| 108 | - { | |
| 109 | - value: 'fuzimiao', | |
| 110 | - label: '夫子庙', | |
| 111 | - } | |
| 112 | - ] | |
| 113 | - }, | |
| 114 | - { | |
| 115 | - value: 'suzhou', | |
| 116 | - label: '苏州', | |
| 117 | - children: [ | |
| 118 | - { | |
| 119 | - value: 'zhuozhengyuan', | |
| 120 | - label: '拙政园', | |
| 121 | - }, | |
| 122 | - { | |
| 123 | - value: 'shizilin', | |
| 124 | - label: '狮子林', | |
| 125 | - } | |
| 126 | - ] | |
| 127 | - } | |
| 128 | - ], | |
| 129 | - }] | |
| 82 | + value2: ['beijing', 'gugong'], | |
| 83 | + data: [] | |
| 130 | 84 | } |
| 131 | 85 | }, |
| 132 | 86 | methods: { |
| 133 | 87 | c () { |
| 134 | 88 | this.value2 = [] |
| 135 | 89 | } |
| 90 | + }, | |
| 91 | + mounted () { | |
| 92 | + this.data = [{ | |
| 93 | + value: 'beijing', | |
| 94 | + label: '北京', | |
| 95 | + children: [ | |
| 96 | + { | |
| 97 | + value: 'gugong', | |
| 98 | + label: '故宫' | |
| 99 | + }, | |
| 100 | + { | |
| 101 | + value: 'tiantan', | |
| 102 | + label: '天坛' | |
| 103 | + }, | |
| 104 | + { | |
| 105 | + value: 'wangfujing', | |
| 106 | + label: '王府井' | |
| 107 | + } | |
| 108 | + ] | |
| 109 | + }, { | |
| 110 | + value: 'jiangsu', | |
| 111 | + label: '江苏', | |
| 112 | + children: [ | |
| 113 | + { | |
| 114 | + value: 'nanjing', | |
| 115 | + label: '南京', | |
| 116 | + children: [ | |
| 117 | + { | |
| 118 | + value: 'fuzimiao', | |
| 119 | + label: '夫子庙', | |
| 120 | + } | |
| 121 | + ] | |
| 122 | + }, | |
| 123 | + { | |
| 124 | + value: 'suzhou', | |
| 125 | + label: '苏州', | |
| 126 | + children: [ | |
| 127 | + { | |
| 128 | + value: 'zhuozhengyuan', | |
| 129 | + label: '拙政园', | |
| 130 | + }, | |
| 131 | + { | |
| 132 | + value: 'shizilin', | |
| 133 | + label: '狮子林', | |
| 134 | + } | |
| 135 | + ] | |
| 136 | + } | |
| 137 | + ], | |
| 138 | + }] | |
| 136 | 139 | } |
| 137 | 140 | } |
| 138 | 141 | </script> | ... | ... |