我有一个带有vue和打字稿的Visual Studio代码设置。 当我尝试在ts文件中导入vue文件时,棉绒无法识别从vue文件导出的默认类的属性。
[ts] Property 'stringProperty' does not exist on type 'ChildComp'. [2339]
我已经建立了一个git项目来复制它。
comp.vue
<template>
<div>
<slot />
</div>
</template>
<script lang="ts">
import Vue from "vue";
export default class Comp extends Vue {
stringProperty: string
}
</script>
child-comp.ts
import Comp from "./comp.vue"
export class ChildComp extends Comp {
isClosable () : boolean
{
console.log(this.stringProperty);
// return this.closable;
return true;
}
}