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/views/content/components/Introduction.vue b/src/views/content/components/Introduction.vue index 6d1ab58..039e0ec 100644 --- a/src/views/content/components/Introduction.vue +++ b/src/views/content/components/Introduction.vue @@ -3,8 +3,8 @@
-
{{value.title}}
-
+
{{ value.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:{ + value(val){ + this.introductionData = val + } + }, + created() { + this.value = { + title: "12", + content: "12" + } + }, }