【发布时间】:2021-12-09 22:03:52
【问题描述】:
我正在尝试在一个组件中进行命名导出,如下所示:
export interface ITest { t: String }
从另一个人那里调用它:
import { ITest } from '@/components/Test.vue'
并且有错误:
TS2614: Module '"*.vue"' has no exported member 'ITest '. Did you mean to use 'import ITest from "*.vue"' instead?
如果我改为:
import ITest from '@/components/Test.vue'
错误现在说:
Module '"(path)/Test.vue"' has no default export. Did you mean to use 'import { ITest } from "(path)/Test.vue"' instead?
如何使用 TypeScript 在 Vue 中进行命名导出?
Vue 3、TypeScript、Webpack 5。
【问题讨论】:
标签: typescript vue.js webpack export vuejs3