import time from "../views/time"function copyobj(obj) { if (typeof obj == "object") { if (array.isarray(obj)) { let arr = []; for (let item of obj) { arr.push(object.assign(copyobj(item))); } return arr; } else if (obj == null) { return null; } else { let obj1 = {}; for (let index in obj) { obj1[index] = copyobj((obj[index])); } return obj1; } } else if (typeof obj == "function") { return object.assign(obj); } else if (typeof obj == undefined) { return undefined; } else { return obj; }}window.pushtime = function () { let t = new date().gettime(); let path = `/time/${t}`; time = copyobj(time) this.$router.addroute({ path, name: path, component: time, }); this.$router.push({ path, });}
以上就是vue3中addroute路由变化但页面未更新如何解决的详细内容。
