diff --git a/examples/routers/cascader.vue b/examples/routers/cascader.vue index 26da699..0f3116f 100644 --- a/examples/routers/cascader.vue +++ b/examples/routers/cascader.vue @@ -147,9 +147,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/cascader/caspanel.vue b/src/components/cascader/caspanel.vue index 5c36499..abc5251 100644 --- a/src/components/cascader/caspanel.vue +++ b/src/components/cascader/caspanel.vue @@ -48,20 +48,23 @@ methods: { handleClickItem (item) { if (this.trigger !== 'click' && item.children) return; - this.handleTriggerItem(item); + this.handleTriggerItem(item, false, true); }, handleHoverItem (item) { if (this.trigger !== 'hover' || !item.children) return; - this.handleTriggerItem(item); + this.handleTriggerItem(item, false, true); }, - handleTriggerItem (item, fromInit = false) { + handleTriggerItem (item, fromInit = false, fromUser = false) { if (item.disabled) return; if (item.loading !== undefined && !item.children.length) { const cascader = findComponentUpward(this, 'Cascader'); if (cascader && cascader.loadData) { cascader.loadData(item, () => { - cascader.isLoadedChildren = true; + // todo + if (fromUser) { + cascader.isLoadedChildren = true; + } this.handleTriggerItem(item); }); return; -- libgit2 0.21.4