Vue3 使用 Element Plus 框架实现双向绑定的文本框示例
<script setup>
import { ref } from 'vue';
const inputValue = ref('');
function handleInput(event) {
  inputValue.value = event.target.value;
}
function clearInput() {
  inputValue.value = '';
}
</script>
<template>
  <div>
    <input v-model='inputValue' @input='handleInput' />
    <button @click='clearInput'>Clear</button>
  </div>
</template>
原文地址: https://www.cveoy.top/t/topic/mB6d 著作权归作者所有。请勿转载和采集!