[improvement] optimize watch options (#4075)

This commit is contained in:
neverland
2019-08-09 11:54:42 +08:00
committed by GitHub
parent 854a91c384
commit 19cd2ed38e
12 changed files with 19 additions and 57 deletions
+2 -4
View File
@@ -99,16 +99,14 @@ export default createComponent({
},
watch: {
color: 'setLine',
active(name) {
if (name !== this.currentName) {
this.setCurrentIndexByName(name);
}
},
color() {
this.setLine();
},
children() {
this.setCurrentIndexByName(this.currentName || this.active);
this.scrollIntoView();