import { ComponentInternalInstance, getCurrentInstance } from 'vue';

//在ts中使用会报错：报错：...类型“ComponentInternalInstance | null”
// 我们在项目中一般会用到很多getCurrentInstance()方法，直接封装一下
export default function useCurrentInstance() {
  const { appContext } = getCurrentInstance() as ComponentInternalInstance;
  const proxy = appContext.config.globalProperties;
  return {
    proxy,
  };
}
