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(); },