72 lines
1.6 KiB
Vue
72 lines
1.6 KiB
Vue
|
|
<template>
|
||
|
|
<div class="resource-menu">
|
||
|
|
<div :class="`menu-item ${select === 1? 'active': ''}`" @click="changeSelect(1)">
|
||
|
|
<div class="item-icon"><LineChartOutlined /></div>
|
||
|
|
<div class="item-text">资源</div>
|
||
|
|
</div>
|
||
|
|
<div :class="`menu-item ${select === 2? 'active': ''}`" @click="changeSelect(2)">
|
||
|
|
<div class="item-icon"><HddOutlined /></div>
|
||
|
|
<div class="item-text">任务</div>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
<div class="resource-content" v-if="[1,2].includes(select)">
|
||
|
|
<Resource v-if="select === 1"/>
|
||
|
|
</div>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<script setup lang="ts">
|
||
|
|
import { ref } from "vue"
|
||
|
|
import { LineChartOutlined, HddOutlined } from "@ant-design/icons-vue"
|
||
|
|
import Resource from './Resource/index.vue'
|
||
|
|
const select = ref(0)
|
||
|
|
const changeSelect = (value) => {
|
||
|
|
if(select.value == value){
|
||
|
|
select.value = 0
|
||
|
|
return
|
||
|
|
}
|
||
|
|
select.value = value
|
||
|
|
}
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<style lang="scss" scoped>
|
||
|
|
.active{
|
||
|
|
background: repeating-linear-gradient(to left,rgb(38, 51, 231),rgb(20, 118, 230)) !important;
|
||
|
|
color: #fff;
|
||
|
|
}
|
||
|
|
.resource-menu{
|
||
|
|
position: absolute;
|
||
|
|
top: 70px;
|
||
|
|
right: 20px;
|
||
|
|
height: 165px;
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
justify-content: space-between;
|
||
|
|
.menu-item{
|
||
|
|
background: #fff;
|
||
|
|
width: 50px;
|
||
|
|
height: 75px;
|
||
|
|
border-radius: 25px;
|
||
|
|
display: flex;
|
||
|
|
flex-direction: column;
|
||
|
|
align-items: center;
|
||
|
|
justify-content: center;
|
||
|
|
transition: 0.2s;
|
||
|
|
}
|
||
|
|
.item-icon{
|
||
|
|
font-size: 20px;
|
||
|
|
margin-bottom: 5px;
|
||
|
|
}
|
||
|
|
.item-text{
|
||
|
|
user-select: none;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.resource-content{
|
||
|
|
position: absolute;
|
||
|
|
top: 70px;
|
||
|
|
right: 90px;
|
||
|
|
width: 500px;
|
||
|
|
padding: 10px;
|
||
|
|
background: #fff;
|
||
|
|
}
|
||
|
|
</style>
|