From 3d7562a4da1ca04fc1263296bb3c91926d74a627 Mon Sep 17 00:00:00 2001 From: Zeeland <287017217@qq.com> Date: Tue, 1 Nov 2022 02:57:34 +0800 Subject: [PATCH] :fix: the preference button in article page does not render correctly in time. --- pages/article/_article_id.vue | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/pages/article/_article_id.vue b/pages/article/_article_id.vue index 2f53a9d..eacbc05 100644 --- a/pages/article/_article_id.vue +++ b/pages/article/_article_id.vue @@ -341,14 +341,8 @@ export default { idArticle: _ts.article.idArticle, articlePerfect: '1', }).then(function (res) { - if (res) { - if (res.success) { - _ts.$set(_ts, 'isPerfect', false); - _ts.$message.success("设置成功!"); - } else { - _ts.$message.error(_ts.message); - } - } + _ts.isPerfect = !_ts.isPerfect; + _ts.$message.success("设置成功!"); }) }, cancelPreference() { @@ -357,14 +351,8 @@ export default { idArticle: _ts.article.idArticle, articlePerfect: '0', }).then(function (res) { - if (res) { - if (res.success) { - _ts.$set(_ts, 'isPerfect', true); - _ts.$message.success("取消成功!"); - } else { - _ts.$message.error(_ts.message); - } - } + _ts.isPerfect = !_ts.isPerfect; + _ts.$message.success("设置成功!"); }) }, thumbsUp() {