vue3中如何像vue2中注册全局插件

转自https://blog.csdn.net/qq_39115469/article/details/113795097

const app   = createApp(App);

 app.config.globalProperties.$axios = axios;

之后在引入的地方 import { getCurrentInstance }  from 'vue';

const { proxy } = getCurrentInstance();

onMounted(() => {

  log(proxy.$axios)

})

原文地址:https://www.cnblogs.com/diligent-noob/p/14911810.html