
vue
是鑫❤呀!
前端的一个小学生
展开
-
vue3临时(后续会修改)
Vue3用后总结vue3链接vue-router4链接vuex4链接vue3全局注册数据在setup中使用app.config.globalProperties.$api = api<script>import {getCurrentInstance} from "vue";export default { setup(){ const { ctx } = getCurrentInstance() const loginUser =原创 2021-01-14 16:53:28 · 287 阅读 · 0 评论 -
Vue3里面全局配置
Vue3里面全局配置= =其实这个问题很早之前就遇到了,但是当时并没有解决,然后就放在js文件里面引入就不了了之了,今天去csdn博客上晨爱衿文老哥回答了我于是我又玩了下。一般网上的教程//在main.js中注册你想注册的东西比如:app.config.globalProperties.hello = ()=>{ console.log("hello,world");}//然后在vue文件中通过getCurrentInstance解构出ctx进行获取比如:import { g原创 2020-11-20 11:21:06 · 2815 阅读 · 2 评论