From 65e7a1ad8653990c5bb08c1e374d91f099ad7092 Mon Sep 17 00:00:00 2001 From: clay <20932067@zju.edu.cn> Date: Tue, 4 Oct 2022 17:17:55 +0800 Subject: [PATCH] =?UTF-8?q?clay=20fix=20:=20=E5=85=B3=E9=97=AD=E4=B8=80?= =?UTF-8?q?=E7=B3=BB=E5=88=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 5 ++ src/views/content/components/Introduction.vue | 40 ++++++++++----- src/views/content/components/dire_data.vue | 48 ++++++++++-------- src/views/content/components/list.vue | 50 +++++++++++-------- src/views/content/index.vue | 46 ++++++++--------- src/views/header/index.vue | 8 ++- src/views/mobile/index.vue | 7 +-- 7 files changed, 122 insertions(+), 82 deletions(-) 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" + } + }, }