Skip to content

Commit dad48eb

Browse files
committed
feat(scroll-nav-bar): sync txts by labels
1 parent 3e47365 commit dad48eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/scroll-nav-bar/scroll-nav-bar.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
txts: {
6262
type: Array,
6363
default() {
64+
this._defaultTxts = true
6465
/* istanbul ignore next */
6566
return this.labels
6667
}
@@ -76,6 +77,11 @@
7677
}
7778
},
7879
watch: {
80+
labels(newLabels) {
81+
if (this._defaultTxts) {
82+
this.txts = newLabels
83+
}
84+
},
7985
current(newVal) {
8086
this.active = newVal
8187
},

0 commit comments

Comments
 (0)