Visual Studio Code Lint无法在依赖于.vue文件的ts文件上正常工作

时间:2018-12-05 15:38:00

标签: typescript vue.js visual-studio-code

我有一个带有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;
    } 

}

0 个答案:

没有答案