From 01105a425e42f9429dda429dfa3912c4cc023972 Mon Sep 17 00:00:00 2001 From: zhaofang <752743406@qq.com> Date: Thu, 29 Sep 2022 16:20:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user/Noteedit.vue | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/views/user/Noteedit.vue b/src/views/user/Noteedit.vue index cde67ee1..6a43873a 100644 --- a/src/views/user/Noteedit.vue +++ b/src/views/user/Noteedit.vue @@ -92,9 +92,9 @@ export default { this.imgContent.splice(index,1); }, comeback(){ - this.$router.go(-1); - clearImmediate(this.timer); + clearInterval(this.timer); this.timer = null; + this.$router.go(-1); }, notedetail(){ apiNote.detail(this.id).then(res=>{ @@ -156,6 +156,7 @@ export default { } if(num == 1) { this.editdata.isAuto = true; + } if(this.imgContent.length > 0) { this.editdata.content = this.imgContent.join(); @@ -164,7 +165,7 @@ export default { if(res.status == 200) { sessionStorage.setItem('isShowTip',''); if(num ==1) {//自动保存 - this.editdata.sysVersion +=1; + this.editdata.sysVersion += 1; this.isShowTip = '笔记自动保存成功'; setTimeout(()=>{ this.isShowTip = ''; @@ -187,9 +188,15 @@ export default { } }, beforeDestroy() { - clearImmediate(this.timer); - this.timer = null; + // clearInterval(this.timer); + // this.timer = null; + clearInterval(this.timer) + this.timer = null }, + destroyed(){ + clearInterval(this.timer) + this.timer = null + } }