From e057500f7f564bd13be062aa8c857276b978982f Mon Sep 17 00:00:00 2001 From: clay <20932067@zju.edu.cn> Date: Thu, 6 Oct 2022 01:14:21 +0800 Subject: [PATCH] =?UTF-8?q?clay=20commit=20:=20bug=E5=9F=BA=E6=9C=AC?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ebts-ui/src/views/sist/article/index.vue | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/ebts-ui/src/views/sist/article/index.vue b/ebts-ui/src/views/sist/article/index.vue index 183380e..5ed2418 100644 --- a/ebts-ui/src/views/sist/article/index.vue +++ b/ebts-ui/src/views/sist/article/index.vue @@ -345,12 +345,9 @@ export default { } }, mounted() { - this.getList() }, created() { - - let roles = JSON.parse(sessionStorage.getItem("roles")) console.log(roles,"roles") for (const role of roles) { @@ -359,9 +356,6 @@ export default { this.isAdmin = true } } - - - getArticleNav().then(res=>{ let data = res.data this.articleTypeOptions = data @@ -385,14 +379,17 @@ export default { this.statusOptions = response.data }) - - - - }, - // activated() { - // this.getList() - // }, + watch: { + $route(now, old) { + // 判断逻辑 + console.log(now,"new") + if (now.name == 'Article') { + // 需要执行的方法 + this.getList() + } + } + }, methods: { /** 查询文章列表 */ getList() {