Skip to content

Typescript: 'Function' type of PropType introduced in 0.5.0 is annoying when using Vetur #291

Closed
@gertqin

Description

@gertqin

When using Vetur's template interpolation service, object props cannot be used directly in the template from 0.5.0, without getting syntax errors:

ss

Exposing the user through setup, i.e.

export default defineComponent({
  props: {
    user: Object as PropType<IUser>,
  },
  setup(props) {
    return { user: props.user as IUser }
  }
});

works for Vetur, but then the console will print warnings:

[Vue warn]: The setup binding property "user" is already declared as a prop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions