I have a component something like this:
interface Data {
currentDirectory: string;
}
@Component({
})
export default class TileMemory extends Vue {
public data(): Data {
return {
currentDirectory: '/',
};
}
public clearDirectory() {
this.$data.currentDirectory = '';
}
}
This appears to work, however this.$data.currentDirectory has the type any, not string even though I annotated the return type of data(). I've tried various things - putting data() in @Component({}) instead (where should it go? nobody seems to know), using this.currentDirectory instead (does not compile).
Is there a way to get proper types for the data object?