在写练手项目时,用到ts和element-plus,将ui组件全局注册后发现无法有ts提示效果,可以尝试以下做法 /// 在main.ts同级处创建components.d.ts 名字任意(必须是d.ts结尾) export { } declare module 'vue' { export interface GlobalComponents { ElButton: typeof import("element-plus/es"