问题遇到的现象和发生背景
vue3使用component渲染input元素和v-model搭配使用时,v-model不起作用
用代码块功能插入代码,请勿粘贴截图
<template>
<component :is="'input'" type="text" v-model="inputValue">
</component>
</template>
<script lang="ts" setup>
const inputValue = ref("");
</script>
运行结果及报错内容
在vue的devtools中会发现inputValue不会发生变化
我的解答思路和尝试过的方法
添加事件可以实现数据变化,但我不想这样做。
我想要达到的结果
使用v-model可以双向绑定