Commit 3bbb6b5f7d20be6a46111ac26684c4ce85b0524f
1 parent
53754a31
fixed #488
Showing
2 changed files
with
4 additions
and
3 deletions
Show diff stats
examples/routers/cascader.vue
@@ -70,9 +70,9 @@ | @@ -70,9 +70,9 @@ | ||
70 | 70 | ||
71 | <template> | 71 | <template> |
72 | <div> | 72 | <div> |
73 | - <Cascader :data="data" v-model="value2" change-on-select></Cascader> | 73 | + <Cascader :data="data" v-model="value2"></Cascader> |
74 | {{ value2 }} | 74 | {{ value2 }} |
75 | - <div @click="c">change</div> | 75 | + <Button @click="c">clear</Button> |
76 | </div> | 76 | </div> |
77 | </template> | 77 | </template> |
78 | <script> | 78 | <script> |
@@ -131,7 +131,7 @@ | @@ -131,7 +131,7 @@ | ||
131 | }, | 131 | }, |
132 | methods: { | 132 | methods: { |
133 | c () { | 133 | c () { |
134 | - this.value2 = ['jiangsu', 'suzhou', 'zhuozhengyuan'] | 134 | + this.value2 = [] |
135 | } | 135 | } |
136 | } | 136 | } |
137 | } | 137 | } |
src/components/cascader/cascader.vue
@@ -208,6 +208,7 @@ | @@ -208,6 +208,7 @@ | ||
208 | }, | 208 | }, |
209 | value (val) { | 209 | value (val) { |
210 | this.currentValue = val; | 210 | this.currentValue = val; |
211 | + if (!val.length) this.selected = []; | ||
211 | }, | 212 | }, |
212 | currentValue () { | 213 | currentValue () { |
213 | this.$emit('input', this.currentValue); | 214 | this.$emit('input', this.currentValue); |