From 47847aabc4af482b263e2c6f89597a29463edf34 Mon Sep 17 00:00:00 2001 From: hlw Date: Sun, 12 Jul 2020 21:54:41 +0800 Subject: [PATCH] fix: reset table data --- src/components/CodemirrorEditor/insertForm.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/CodemirrorEditor/insertForm.vue b/src/components/CodemirrorEditor/insertForm.vue index c2dc28c..08216f2 100644 --- a/src/components/CodemirrorEditor/insertForm.vue +++ b/src/components/CodemirrorEditor/insertForm.vue @@ -106,8 +106,10 @@ export default { table += currRow.join("|"); table += "|\n"; } - - this.editor.replaceSelection(`\n${table}\n`, cursor); + this.tableData = {}; + this.rowNum = 1; + this.colNum = 1; + this.editor.replaceSelection(`\n${table}\n`, "end"); this.$emit("close"); this.editorRefresh(); },