fixed #1922
This commit is contained in:
parent
6c634aa631
commit
a5f4a1d458
2 changed files with 4 additions and 17 deletions
|
@ -1,6 +1,6 @@
|
|||
<template>
|
||||
<div style="width: 200px;margin: 100px;">
|
||||
<Cascader :data="data" v-model="value1"></Cascader>
|
||||
<Cascader :data="data" v-model="value1" trigger="hover"></Cascader>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
|
@ -11,20 +11,7 @@
|
|||
data: [{
|
||||
value: 'beijing',
|
||||
label: '北京',
|
||||
children: [
|
||||
{
|
||||
value: 'gugong',
|
||||
label: '故宫'
|
||||
},
|
||||
{
|
||||
value: 'tiantan',
|
||||
label: '天坛'
|
||||
},
|
||||
{
|
||||
value: 'wangfujing',
|
||||
label: '王府井'
|
||||
}
|
||||
]
|
||||
children: []
|
||||
}, {
|
||||
value: 'jiangsu',
|
||||
label: '江苏',
|
||||
|
|
|
@ -49,11 +49,11 @@
|
|||
},
|
||||
methods: {
|
||||
handleClickItem (item) {
|
||||
if (this.trigger !== 'click' && item.children) return;
|
||||
if (this.trigger !== 'click' && item.children && item.children.length) return; // #1922
|
||||
this.handleTriggerItem(item, false, true);
|
||||
},
|
||||
handleHoverItem (item) {
|
||||
if (this.trigger !== 'hover' || !item.children) return;
|
||||
if (this.trigger !== 'hover' || !item.children || !item.children.length) return; // #1922
|
||||
this.handleTriggerItem(item, false, true);
|
||||
},
|
||||
handleTriggerItem (item, fromInit = false, fromUser = false) {
|
||||
|
|
Loading…
Add table
Reference in a new issue