diff --git a/src/App.vue b/src/App.vue index 913e060..c58e9d7 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,6 +1,6 @@ @@ -54,6 +65,7 @@ body { height: 100vh; // position: relative; // background-image: url("assets/g_bg.jpg"); + // background-image: var(--bg); // background-size: 100%; // background-repeat: no-repeat; diff --git a/src/assets/ty/bg.jpg b/src/assets/ty/bg.jpg new file mode 100644 index 0000000..78ff60c Binary files /dev/null and b/src/assets/ty/bg.jpg differ diff --git a/src/assets/wh/bg.jpg b/src/assets/wh/bg.jpg new file mode 100644 index 0000000..78ff60c Binary files /dev/null and b/src/assets/wh/bg.jpg differ diff --git a/src/router/index.js b/src/router/index.js index f2b3782..85b5a0b 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -8,28 +8,37 @@ const routes = [ { path: '/', name: 'index', - component: () => import('../views/index.vue') + component: () => import('../views/index.vue'), + meta:{ + img:require("../assets/index/bg.jpg") + } + }, -// 总览 +// 文化 { - path: '/dashboard', - name: 'dashboard', - component: ()=>import("../views/dashboard/index.vue") - + path: '/cultrue', + name: 'cultrue', + component: ()=>import("../views/cultrue/index.vue"), + meta:{ + img:require("@/assets/wh/bg.jpg") + } }, + // 体育 { path: '/ty', name: 'ty', - component: ()=>import("../views/ty/index.vue") - + component: ()=>import("../views/ty/index.vue"), + meta:{ + img:require("@/assets/ty/bg.jpg") + } } ] const router = new VueRouter({ - mode: "history", + mode: "hash", routes }) diff --git a/src/views/cultrue/index.vue b/src/views/cultrue/index.vue new file mode 100644 index 0000000..a0a02cd --- /dev/null +++ b/src/views/cultrue/index.vue @@ -0,0 +1,21 @@ + + \ No newline at end of file diff --git a/src/views/index.vue b/src/views/index.vue index 83fa9c7..276e9b9 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -9,15 +9,12 @@ export default{ data(){ return{ - // 首页背景图片 - bgimg:'assets/index/bg.jpg' + // } }, - // computed(){ - // this.$emit.bgimg = require (this.bgimg) - // }, - // mounted(){ - // this.$emit.bgimg = require (this.bgimg) - // } + mounted(){ + console.log("index.vue") + console.log(this.$route.meta) + } } diff --git a/src/views/ty/index.vue b/src/views/ty/index.vue index e0a1be4..ffca894 100644 --- a/src/views/ty/index.vue +++ b/src/views/ty/index.vue @@ -1,3 +1,21 @@ \ No newline at end of file + +