adr*_*aus 5 typescript vue.js nuxt.js
我的打字稿编译器不会将返回的data类型添加到CombinedVueInstance. 我的组件:
import Vue from \'vue\';\n\nexport default Vue.extend({\n data() {\n return { title: \'\' };\n },\n head() {\n return { title: this.title };\n },\n});\nRun Code Online (Sandbox Code Playgroud)\n在编译时(以及在 Vetur 中),我收到错误Property \'title\' does not exist on type \'CombinedVueInstance<Vue, unknown, unknown, unknown, Readonly<Record<never, any>>>\'.,如果我尝试this.title在计算属性或其他地方使用,同样如此。
I\xe2\x80\x99m 使用 Nuxt (v2.15.7) 在适当的位置配置了 @nuxt/typescript-build 和 @nuxt/types 。
\n| 归档时间: |
|
| 查看次数: |
780 次 |
| 最近记录: |