From 6908614ec9d096fbea03f15e94966f2e296ed5e6 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Mon, 24 Dec 2018 23:16:54 +0300 Subject: [PATCH] Reimplement TabView active tab handling --- src/components/accordion/AccordionTab.vue | 10 ++-- src/components/tabview/TabPanel.vue | 10 +++- src/components/tabview/TabView.vue | 60 +++++++++++------------ src/views/tabview/TabViewDemo.vue | 12 ++--- 4 files changed, 48 insertions(+), 44 deletions(-) diff --git a/src/components/accordion/AccordionTab.vue b/src/components/accordion/AccordionTab.vue index affc7247b..9edbb12c1 100644 --- a/src/components/accordion/AccordionTab.vue +++ b/src/components/accordion/AccordionTab.vue @@ -5,16 +5,16 @@ export default { active: Boolean, disabled: Boolean }, - watch: { - active(newValue) { - this.d_active = newValue; - } - }, data() { return { d_active: this.active } }, + watch: { + active(newValue) { + this.d_active = newValue; + } + }, render() { return null; } diff --git a/src/components/tabview/TabPanel.vue b/src/components/tabview/TabPanel.vue index b654a68bc..49b8ddc3f 100644 --- a/src/components/tabview/TabPanel.vue +++ b/src/components/tabview/TabPanel.vue @@ -1,5 +1,5 @@ @@ -8,11 +8,17 @@ export default { props: { header: null, + active: Boolean, disabled: Boolean }, data() { return { - active: false + d_active: this.active + } + }, + watch: { + active(newValue) { + this.d_active = newValue; } } } diff --git a/src/components/tabview/TabView.vue b/src/components/tabview/TabView.vue index 2c157d549..00e62d734 100644 --- a/src/components/tabview/TabView.vue +++ b/src/components/tabview/TabView.vue @@ -1,63 +1,61 @@