From 04d656131509b709b0f92a847bc933f037f3347f Mon Sep 17 00:00:00 2001 From: chenjiahan Date: Sun, 20 Dec 2020 19:50:19 +0800 Subject: [PATCH] fix(Cascader): incorrect tabs --- src/cascader/index.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cascader/index.js b/src/cascader/index.js index efef6be69..b8c3e155d 100644 --- a/src/cascader/index.js +++ b/src/cascader/index.js @@ -27,7 +27,7 @@ export default createComponent({ watch: { options() { - // reset options and tab + this.updateTabs(); }, value(value) { @@ -92,7 +92,14 @@ export default createComponent({ return tab; }); - this.activeTab = selectedOptions.length - 1; + if (optionsCursor) { + this.tabs.push({ + options: optionsCursor, + selectedOption: null, + }); + } + + this.activeTab = this.tabs.length - 1; return; }