Merge pull request #309 from rijn/307
fix bug: cascader still can be opened if set to disabled
This commit is contained in:
commit
5d05754ebc
2 changed files with 11 additions and 0 deletions
|
@ -129,6 +129,7 @@
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
},
|
},
|
||||||
toggleOpen () {
|
toggleOpen () {
|
||||||
|
if (this.disabled) return false;
|
||||||
if (this.visible) {
|
if (this.visible) {
|
||||||
this.handleClose();
|
this.handleClose();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -3,11 +3,21 @@
|
||||||
<Cascader :data="data" @on-change="handleChange">
|
<Cascader :data="data" @on-change="handleChange">
|
||||||
<a href="javascript:void(0)">选择</a>
|
<a href="javascript:void(0)">选择</a>
|
||||||
</Cascader>
|
</Cascader>
|
||||||
|
|
||||||
|
<Row>
|
||||||
|
<i-col span="4">
|
||||||
|
Disabled <Switch :checked.sync="disabled"></Switch>
|
||||||
|
</i-col>
|
||||||
|
<i-col span="4">
|
||||||
|
<Cascader :data="data" :value.sync="value1" :disabled="disabled"></Cascader>
|
||||||
|
</i-col>
|
||||||
|
</Row>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
export default {
|
export default {
|
||||||
data () {
|
data () {
|
||||||
return {
|
return {
|
||||||
|
disabled: false,
|
||||||
text: '未选择',
|
text: '未选择',
|
||||||
data: [{
|
data: [{
|
||||||
value: 'beijing',
|
value: 'beijing',
|
||||||
|
|
Loading…
Add table
Reference in a new issue