hsgy/src/views/Biology.vue

82 lines
1.6 KiB
Vue

<template>
<div class="cl-hy">
<div class="menus">
<Menus :activeI="0" @changeIndex="changeIndex" :menus="menus"/>
</div>
<div class="content">
<Bindex v-if="index === 0"/>
<Zhibiao v-else-if="index === 1"/>
<Analyse v-else-if="index === 2"/>
<History v-else-if="index === 3"/>
</div>
</div>
</template>
<script>
import Menus from "@/components/Menus.vue";
import Bindex from "@/components/Bindex.vue";
import Zhibiao from "@/components/Zhibiao2.vue";
import Analyse from "@/components/Ganalyse2.vue";
import History from "@/components/History.vue";
import { onMounted, reactive, ref, toRefs, nextTick } from "vue";
export default {
name: 'weather',
components: {
Menus,
Bindex,
Zhibiao,
Analyse,
History
},
setup(props, ctx) {
const state = reactive({
index: 0,
menus:[
{
name: '首页',
},
{
name: '监测指标',
},
{
name: '数据分析',
},
{
name: '历史数据',
}
],
})
const changeIndex = (index) => {
state.index = index;
}
return {
...toRefs(state),
changeIndex
}
}
}
</script>
<style lang="scss" scoped>
.mt10 {
margin-top: 10px;
}
.cl-hy {
width: 100%;
height:100%;
display: flex;
justify-content: space-between;
// border: 1px solid red;
.menus {
width: 4%;
height: 700px;
// border: 1px solid red;
}
.content {
width: 96%;
height:100%;
// border: 1px solid red;
}
}
</style>