Suppose a Vue component is written like
import { Vue, Component } from "vue-property-decorator";
// ...
@Component({
setup () {
const { something } = useComposable();
return { something }
}
})
export default class DummyComponent extends Vue {
doSomething(command: string) {
this.something // issue
}
}
Two issues here:
TS2339: Property 'something' does not exist on type 'DummyComponent'.
andthis.something
is not typed.
Adding an index signature ([x: string]: any;
) seems like a bad workaround to satisfy the linter / tsc and setting the return type of the setup method does not solve the issue #1. Is there the right way to do it or am I mixing stuff that's not supposed to be mixed. I'm sure the awesome Vue devs thought of that?
What's the proper way to satisfy tsc
?