perf: 删除ref
This commit is contained in:
@ -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);
|
||||
|
||||
@ -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);
|
||||
@ -186,7 +181,7 @@ const handleTextareaScroll = (e: Event) => {
|
||||
caret-color: #211f24 !important;
|
||||
@include textarea-padding;
|
||||
|
||||
// -webkit-text-fill-color: transparent !important;
|
||||
// -webkit-text-fill-color: transparent !important;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.arco-textarea-word-limit {
|
||||
|
||||
Reference in New Issue
Block a user