Skip to content

Commit

Permalink
Refactor user/index.vue and user-like-article.vue for better code org…
Browse files Browse the repository at this point in the history
…anization and readability
  • Loading branch information
luoyunchong committed May 19, 2024
1 parent 288a36c commit c5c58da
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions src/view/user/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -201,22 +201,24 @@ export default {
// await this.getUserSubscribe()
},
mounted() {
switch (this.name) {
case 'article':
case 'subscribe':
case 'collection':
case 'like':
this.tab = this.name
break
default:
this.tab = 'article'
break
}
let key = this.$route.query.key
if (key == null || key == undefined) {
key = 'subscribe'
}
this.activeName = key
setTimeout(() => {
switch (this.name) {
case 'article':
case 'subscribe':
case 'collection':
case 'like':
this.tab = this.name
break
default:
this.tab = 'article'
break
}
let key = this.$route.query.key
if (key == null || key == undefined) {
key = 'subscribe'
}
this.activeName = key
}, 500)
},
methods: {
async deleteArticle() {
Expand Down

0 comments on commit c5c58da

Please sign in to comment.