perf: 删除ref

This commit is contained in:
rd
2025-08-13 15:18:45 +08:00
parent 0037b7c877
commit 8e1326b5f0
2 changed files with 1 additions and 12 deletions

View File

@ -1,7 +1,6 @@
<template>
<div class="highlight-textarea-container">
<a-textarea
ref="textareaRef"
v-model="inputValue"
placeholder="请输入作品描述"
:disabled="disabled"
@ -15,7 +14,6 @@
/>
<div
ref="highlightRef"
class="textarea-highlight"
:class="{ focus: focus }"
:style="{ visibility: inputValue ? 'visible' : 'hidden' }"
@ -49,10 +47,6 @@ const emit = defineEmits<{
(e: 'update:modelValue', value: string): void;
}>();
// 内部状态管理
// 修复highlightRef类型定义
const textareaRef = ref<HTMLTextAreaElement | null>(null);
const highlightRef = ref<HTMLTextAreaElement | null>(null);
const inputValue = ref(props.modelValue || '');
const scrollTop = ref(0);
const focus = ref(false);

View File

@ -1,7 +1,6 @@
<template>
<div class="highlight-textarea-container">
<a-textarea
ref="textareaRef"
v-model="inputValue"
placeholder="请输入作品描述"
:disabled="disabled"
@ -15,7 +14,6 @@
/>
<div
ref="highlightRef"
class="textarea-highlight"
:class="{ focus: focus }"
:style="{ visibility: inputValue ? 'visible' : 'hidden' }"
@ -50,9 +48,6 @@ const emit = defineEmits<{
}>();
// 内部状态管理
// 修复highlightRef类型定义
const textareaRef = ref<HTMLTextAreaElement | null>(null);
const highlightRef = ref<HTMLTextAreaElement | null>(null);
const inputValue = ref(props.modelValue || '');
const scrollTop = ref(0);
const focus = ref(false);