-
Notifications
You must be signed in to change notification settings - Fork 149
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
🐛 Bug description
when I use v-model:[key]="title"
in tsx,it is not work. Is there a problem with my writing?
thanks!
// test.tsx
import { defineComponent, ref } from "vue";
import MyComp from "./my-comp";
export default defineComponent({
setup(){
const title = ref('this is title')
const key = 'title'
return () => <>
test comp (tsx)
<MyComp v-model:title={ title.value }></MyComp>
<MyComp v-model={ [title.value, 'title']}></MyComp>
<h4 style="color: red">this is not working </h4>
<MyComp v-model={ [title.value, key]}></MyComp>
</>
}
})
// my-comp.tsx
import { defineComponent, PropType } from "vue";
export default defineComponent({
props: {
title: String as PropType<string>,
'update:title': Function as PropType<() => void>
},
setup(props, { emit }){
return () => <div>
<div>{ props.title }</div>
<button onClick={ () => emit('update:title', props.title + '_a') }>change</button>
</div>
}
})
🏞 Desired result
🚑 Other information
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working