I'm building nuxt.js app with typescript.
(我正在使用打字稿构建nuxt.js应用程序。)
This is my code:(这是我的代码:)
<script lang='ts'>
import {Component, Vue} from 'nuxt-property-decorator';
import {LOCATION} from '~/constants/graphql/location';
@Component({
apollo: {
getLocation: {
query: LOCATION,
variables(): object {
return {
id: 10,
};
},
prefetch: true,
},
},
})
export default class Home extends Vue {
}
</script>
I have error:
(我有错误:)
Argument of type '{ apollo: { getLocation: { query: any; variables(): object; prefetch: boolean; }; }; }' is not assignable to parameter of type 'VueClass<Vue>'.
Object literal may only specify known properties, and 'apollo' does not exist in type 'VueClass'.
(对象文字只能指定已知的属性,而'apollo'在'VueClass'类型中不存在。)
I know it's come from TS but how to fix it?
(我知道它来自TS,但如何解决?)
ask by Filip Wroński translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…