![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
vue随手记
秦时明月QS
这个作者很懒,什么都没留下…
展开
-
vue3中如何更新数据
vue3中开始全面使用TS,当我们将一个对象做个可侦听对象时,reactive实际捕捉的是内部属性的变化,我们需要通过拷贝的方式才能触发页面更新,数组必须使用push的方式 let cluster = reactive({} as Cluster); let hostList = reactive([] as Hosts[]); async function Init() { await getAllCluster().then((rep) => { Object.原创 2021-04-13 18:23:56 · 3725 阅读 · 0 评论 -
vue3获取路由地址
vue3中无法使用vue2的方式获取路由地址 现在需要通过代理的方式获取路由 const proxy = getCurrentInstance()?.proxy; const currentPath = computed(() => proxy?.$route.path);原创 2021-04-13 18:20:34 · 640 阅读 · 0 评论