<el-input
ref="inputRef"
v-model="formData.antTemplateContent"
rows="5"
type="textarea"
placeholder="请输入模板内容"
>
</el-input>
const insertText = (textToInsert = '插入的文本') => {
if (inputRef.value) {
const textarea = inputRef.value.$el.querySelector('textarea');
const start = textarea.selectionStart;
const end = textarea.selectionEnd;
const textBefore = textarea.value.substring(0, start);
const textAfter = textarea.value.substring(end, textarea.value.length);
textarea.value = textBefore + textToInsert + textAfter;
textarea.setSelectionRange(start + textToInsert.length, start + textToInsert.length);
textarea.focus();
}
};