From 8279880c310f32b4f933101bbd18e64b4ba29981 Mon Sep 17 00:00:00 2001 From: dolymood Date: Fri, 12 Jul 2019 14:54:44 +0800 Subject: [PATCH] feat(scroll-nav-bar): sync txts by labels --- src/components/scroll-nav-bar/scroll-nav-bar.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/scroll-nav-bar/scroll-nav-bar.vue b/src/components/scroll-nav-bar/scroll-nav-bar.vue index ad452e83..16fbc37b 100644 --- a/src/components/scroll-nav-bar/scroll-nav-bar.vue +++ b/src/components/scroll-nav-bar/scroll-nav-bar.vue @@ -61,6 +61,7 @@ txts: { type: Array, default() { + this._defaultTxts = true /* istanbul ignore next */ return this.labels } @@ -76,6 +77,11 @@ } }, watch: { + labels(newLabels) { + if (this._defaultTxts) { + this.txts = newLabels + } + }, current(newVal) { this.active = newVal }, -- GitLab