使用 Vue 类组件,如何获取计算变量的值?尝试使用this.bar
会报错:Property 'bar' does not exist on type 'Vue'.
<script lang="ts">
import { Vue, Component } from "vue-property-decorator";
@Component({
computed: {
bar() {
return true;
},
},
methods: {
qux() {
// How to get the value of bar here?
if (this.bar) {
baz();
}
},
},
})
export default class Foo extends Vue {}
</script>