vue-tsx-support icon indicating copy to clipboard operation
vue-tsx-support copied to clipboard

value doesn't work with vModel

Open Maxim-Mazurok opened this issue 2 years ago • 0 comments

I want to use my component like this:

<NewFolderDialog vModel={this.newFolderDialogIsActive} />

So I did this:

export default tsx.component({
  name: "NewFolderDialog",
  props: {
    value: {
      type: Boolean as PropType<boolean>,
      required: true,
    },
  },
  model: {
    prop: "value",
    event: "active",
  },
//...

But I'm getting No overload matches this call error: Property 'value' is missing in type '{ vModel: boolean; }' but required in type '{ value: boolean; }'

It'd be great if I could use vModel with value prop in TSX. And even better if I could change the prop name using model.prop.

Workaround for me is to remove required from the value prop. Another workaround would be to "expand" vModel manually.

Maxim-Mazurok avatar Jan 28 '22 02:01 Maxim-Mazurok