11
This commit is contained in:
21
src/App.vue
21
src/App.vue
@ -1,9 +1,30 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
|
<Header id="header" />
|
||||||
<router-view />
|
<router-view />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Header from "@/views/header/index.vue";
|
||||||
|
export default {
|
||||||
|
name: "",
|
||||||
|
components: {
|
||||||
|
Header,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {};
|
||||||
|
},
|
||||||
|
mounted() {},
|
||||||
|
methods: {},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@import "@/assets/scss/index.scss";
|
@import "@/assets/scss/index.scss";
|
||||||
|
|
||||||
|
#header {
|
||||||
|
width: 100%;
|
||||||
|
height: 74px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export default {
|
|||||||
setActiveIndex(id) {
|
setActiveIndex(id) {
|
||||||
if (this.activeIndex !== id) {
|
if (this.activeIndex !== id) {
|
||||||
this.activeIndex = id;
|
this.activeIndex = id;
|
||||||
this.$bus.emit("setActiveIndex", this.activeIndex);
|
this.$bus.$emit("setActiveIndex", this.activeIndex);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="home">
|
<div id="home"></div>
|
||||||
<Header id="header" />
|
|
||||||
</div>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@ -14,10 +12,13 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {};
|
return {};
|
||||||
},
|
},
|
||||||
mounted() {},
|
mounted() {
|
||||||
|
this.receiveBUS();
|
||||||
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
receiveBUS() {
|
receiveBUS() {
|
||||||
this.$bus.on("setActiveIndex", (val) => {
|
this.$bus.$on("setActiveIndex", (val) => {
|
||||||
console.log("val===>", val);
|
console.log("val===>", val);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -29,9 +30,5 @@ export default {
|
|||||||
#home {
|
#home {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
#header {
|
|
||||||
width: 100%;
|
|
||||||
height: 74px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user