Commit 2aa0aa6e6fc94048cb81f776d5d8bd312e957a0f

Authored by Rijn
1 parent 816ff2a3

fix bug: cascader still can be opened if set to disabled

src/components/cascader/cascader.vue
... ... @@ -129,6 +129,7 @@
129 129 this.visible = false;
130 130 },
131 131 toggleOpen () {
  132 + if (this.disabled) return false;
132 133 if (this.visible) {
133 134 this.handleClose();
134 135 } else {
... ...
test/routers/cascader.vue
... ... @@ -3,11 +3,21 @@
3 3 <Cascader :data="data" @on-change="handleChange">
4 4 <a href="javascript:void(0)">选择</a>
5 5 </Cascader>
  6 +
  7 + <Row>
  8 + <i-col span="4">
  9 + Disabled <Switch :checked.sync="disabled"></Switch>
  10 + </i-col>
  11 + <i-col span="4">
  12 + <Cascader :data="data" :value.sync="value1" :disabled="disabled"></Cascader>
  13 + </i-col>
  14 + </Row>
6 15 </template>
7 16 <script>
8 17 export default {
9 18 data () {
10 19 return {
  20 + disabled: false,
11 21 text: '未选择',
12 22 data: [{
13 23 value: 'beijing',
... ...