// methods: insertSomething: function(insert) { const self = this; var tArea = this.$refs.yourTextarea; // filter: if (0 == insert) { return; } if (0 == cursorPos) { return; } // get cursor's position: var startPos = tArea.selectionStart, endPos = tArea.selectionEnd, cursorPos = startPos, tmpStr = tArea.value; // insert: self.txtContent = tmpStr.substring(0, startPos) + insert + tmpStr.substring(endPos, tmpStr.length); // move cursor: setTimeout(() => { cursorPos += insert.length; tArea.selectionStart = tArea.selectionEnd = cursorPos; }, 10); }