diff --git a/src/router/index.js b/src/router/index.js index 7353a73..9f909cb 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,6 +2,11 @@ import Vue from 'vue' import VueRouter from 'vue-router' Vue.use(VueRouter) +const originalPush = VueRouter.prototype.push + +VueRouter.prototype.push = function push(location) { + return originalPush.call(this, location).catch(err => err) +} const routes = [ // { diff --git a/src/utils/sist.js b/src/utils/sist.js index 638ef11..ab61a3b 100644 --- a/src/utils/sist.js +++ b/src/utils/sist.js @@ -15,7 +15,6 @@ export function setThis(that) { export function getParentNode(id) { try { let menuList = JSON.parse(sessionStorage.getItem("menu")); - console.log(menuList,"menuList") for (let menu of menuList) { for (let child of menu.children) { if (id == child.encodeId) { diff --git a/src/views/content/components/Introduction.vue b/src/views/content/components/Introduction.vue index 6d1ab58..568e67f 100644 --- a/src/views/content/components/Introduction.vue +++ b/src/views/content/components/Introduction.vue @@ -3,8 +3,8 @@ - {{value.title}} - + {{ introductionData.title }} + @@ -15,30 +15,45 @@ export default { name: "Introduction", props: { - value: { + introduction: { type: Object, - default: { - title:"12", - content:"12" + default() { + return { + } }, }, }, - data(){ - return{} - } + data() { + return { + introductionData : this.value + } + }, + watch:{ + introduction(val){ + this.introductionData = val + } + }, + created() { + this.value = { + title: "12", + content: "12" + } + }, }