Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
szuprefix committed Nov 9, 2019
1 parent 915fb72 commit 529f2c4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/components/layout/ViewTabs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,21 @@
curTab: '/'
}
},
created (){
created () {
this.curTab = this.$route.path
this.changeRoute(this.$route)
this.$store.state.bus.$on("tab-destroy", this.tabRemove)
this.$store.state.bus.$on('tab-destroy', this.tabRemove)
},
components: {},
methods: {
ellipsis(s){
ellipsis (s) {
return s.length > 19 ? `${s.substr(0, 16)}...` : s
},
clearTabs(){
clearTabs () {
this.curTab = '/'
this.tabs = [this.tabs.find((tab) => tab.name == this.curTab)]
},
tabRemove(name){
tabRemove (name) {
let targetName = name
if (this.curTab === targetName) {
this.tabs.forEach((tab, index) => {
Expand All @@ -53,7 +53,7 @@
}
this.curTab = tab.name
},
changeRoute(newVal, oldVal){
changeRoute (newVal, oldVal) {
// console.log(newVal)
// console.log(oldVal)
let to = newVal
Expand All @@ -78,12 +78,12 @@
}
},
watch: {
curTab(){
curTab () {
if (this.$route.path !== this.curTab) {
this.$router.push(this.resolveRoutePath(this.curTab))
}
},
$route(newVal, oldVal){
$route (newVal, oldVal) {
this.changeRoute(newVal, oldVal)
}
},
Expand Down

0 comments on commit 529f2c4

Please sign in to comment.