<el-input
:ref="($event) => setRef($event)"
v-model="inputValue"
placeholder="请输入"
/>
<script setup>
const InputRef = ref();
const setRef = (e) => {
InputRef.value = e;
};
</script>
<el-input
:ref="($event) => setRef($event)"
v-model="inputValue"
placeholder="请输入"
/>
<script setup>
const InputRef = ref();
const setRef = (e) => {
InputRef.value = e;
};
</script>
本文标题:vue3 动态设置ref
本文链接:https://www.haomeiwen.com/subject/agcofjtx.html
网友评论