ts export 怎么导出一个文件夹中的多个文件的interface一行代码
这不是一行代码可以完成的,需要在每个文件中定义interface,然后分别export出来,在需要使用的文件中import即可。例如:
FileA.ts:
export interface InterfaceA { // interface code here }
FileB.ts:
export interface InterfaceB { // interface code here }
MainFile.ts:
import { InterfaceA } from './FileA'; import { InterfaceB } from './FileB';
// use InterfaceA and InterfaceB here
原文地址: https://www.cveoy.top/t/topic/hwEN 著作权归作者所有。请勿转载和采集!