Skip to content

[BUG] v-model arguments is not work in tsx #602

@NidusP

Description

@NidusP

🐛 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

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions