wujianwei
2026-02-02 7865c2a70e8cf9d0f44e66131bdc98bcea089c7c
1
2
3
4
5
6
7
8
9
10
import {ComponentInternalInstance, getCurrentInstance} from "vue";
 
/**
 * ts 全局挂在会报错,只能先转一下
 */
export default function useCurrentInstance() {
    const {appContext} = getCurrentInstance() as ComponentInternalInstance
    const proxy = appContext.config.globalProperties;
    return {proxy}
}