ComponentCustomProperties
用于扩充组件实例类型以支持自定义全局属性。
例子
import axios from 'axios' declare module 'vue' { interface ComponentCustomProperties { $http: typeof axios $translate: (key: string) => string } }
增强必须放在模块.ts或.d.ts文件中。
用于扩充组件实例类型以支持自定义全局属性。
import axios from 'axios' declare module 'vue' { interface ComponentCustomProperties { $http: typeof axios $translate: (key: string) => string } }
增强必须放在模块.ts或.d.ts文件中。