You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
1.8 KiB

3 months ago
<template>
<div id="app">
<!-- <nav>
3 months ago
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link> |
<router-link to="/ui">组件示例文件</router-link>
</nav> -->
<!-- <router-view/> -->
<el-container>
<el-header>
<Header></Header>
</el-header>
<el-container>
<SliderMenu v-if="showSidebar"></SliderMenu>
<el-container>
<el-main>
<router-view/>
</el-main>
<el-footer v-if="showFooter">
<Footer></Footer>
</el-footer>
</el-container>
</el-container>
</el-container>
3 months ago
</div>
</template>
<script>
import SliderMenu from '@/components/SliderMenu.vue';
import Footer from '@/components/Footer.vue';
import { mapState } from 'vuex';
import Header from './components/Header.vue';
export default {
data() {
return {
isCollapse: true
};
},
components: {
SliderMenu,
Footer,
Header
},
computed: {
...mapState(['showSidebar,showFooter']) // 从Vuex映射showSidebar状态到组件的计算属性中
},
methods: {
handleOpen(key, keyPath) {
console.log(key, keyPath);
},
handleClose(key, keyPath) {
console.log(key, keyPath);
}
}
}
</script>
3 months ago
<style lang="scss">
body{
font-family: Microsoft YaHei UI;
font-size: 14px;
margin: 0;
width: 100vw;
height: 100vh;
p{
margin: 0;
padding: 0;
}
}
3 months ago
#app {
font-family: Avenir, Helvetica, Arial, sans-serif;
font-family: Microsoft YaHei UI;
3 months ago
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
text-align: center;
color: #2c3e50;
height: 100%;
3 months ago
}
nav {
padding: 30px;
a {
font-weight: bold;
color: #2c3e50;
&.router-link-exact-active {
color: #42b983;
}
}
}
</style>