typescript - Vue/Typescript,获取模块 '"*.vue"' 没有导出成员

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

我想从 .vue 文件中导出多个接口(interface)以及 Component

基本.vue:

<template>
    <div class="app">
        <router-view></router-view>
    </div>
</template>

<script lang="ts">
import { Vue, Component } from "vue-property-decorator";

export interface IBasic {
    name :string;
}

/**
 * Simplest container
 */
@Component
export class Basic extends Vue {}
export default Basic;
</script>

但是当我从另一个 .ts 文件导入它时,我得到:

enter image description here

如何才能成功导入接口(interface)?

最佳答案

我遇到了同样的问题,并意识到尽管我的 IDE 上没有错误,但错误仍然抛出,所以我只需重新启动服务器,它就可以正常工作了...我必须这样做每次我使用 TS 创建导入或导出任何内容时。

关于typescript - Vue/Typescript,获取模块 '"*.vue"' 没有导出成员,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56126929/

相关文章:

javascript - typescript 装饰器 : Add instance field to class to use within the same class

javascript - Vue Typescript Konva。 Canvas onClick 抛出 "Uncaught SyntaxError: Function statements require a function name"

amazon-web-services - Amplify 安装到现有 Vue/Bootstrap 项目时出错 : You may need an appropriate loader to handle this file type

android - flutter 错误sdkmanager错误!!! Windows 10

正则表达式只保留标签之间的内容但选择所有内容

javascript - 错误: Expected spy create to have been called

angular - 使用 F5 在 Angular 项目中进行 vscode TypeScript 调试。没有破裂或在错误的地方

javascript - Async/Await 导致循环

javascript - 如何将多个 Axios 调用链接在一起,以便它们同步运行并且每个调用都可以使用前一个调用返回的数据

visual-studio-code - 调试配置之间的快捷方式切换