Typescript support with class syntax and nuxt-property-decorator / vue-property-decorator
zach-at-healthpilot opened this issue · comments
zach-at-healthpilot commented
Does anyone know how to get typescript support when using class syntax and nuxt-property-decorator / vue-property-decorator in a single file component (SFC)
@Component({
setup(props, context) {
const { updating } = updatingFn();
return {
updating,
};
},
})
export default class MyClass extends Vue {
get updatingComputed() {
return this.updating; // throws a Typescript error, 'updating' not a property on MyClass
}
}
error:
TS2339: Property 'updating' does not exist on type 'MyClass'.
MinatoHikari commented
const Composition = defineComponent({
})
@Component({})
export default class MyClass extends Mixins(Composition) {
get updatingComputed() {
return this.updating;
}
}
don't code in @component, unless vue-property-decorator update something.
zach-at-healthpilot commented
Thank you this is very helpful, but I can't find where Mixins
is coming from. [edit] oh, maybe it's the lowercase mixins
from 'nuxt-property-decorator'
?
MinatoHikari commented
Yeah, in vue-property-decorator mixins is be renamed to Mixins
github-actions commented
Stale issue message