<template>
|
<view>
|
<text>{{username}}</text>
|
<text>{{age}}</text>
|
<view class="z-swiper">
|
<view>
|
今日入库 100
|
</view>
|
<view>
|
今日出库 100
|
</view>
|
<view>
|
入库单品
|
</view>
|
<view>
|
Top 1. 冻猪碎肉
|
Top 2. 冻猪排
|
</view>
|
</view>
|
<view class="home-list" v-for="(item,i) in homeList" :key="i">
|
<view class="list-title flex-align-center">
|
<view class="list-title-tag "></view>
|
<view>{{item.name}}</view>
|
</view>
|
<view class="list-detl">
|
<view v-for="nav in item.nav">
|
<view style="margin: 10px;">
|
{{nav.name}}
|
</view>
|
</view>
|
</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'//引入mapState
|
export default {
|
data() {
|
return {}
|
},
|
onShow() {
|
console.log(this.project);
|
},
|
computed: mapState({
|
// 从state中拿到数据 箭头函数可使代码更简练
|
username: state => state.username,
|
age: state => state.age,
|
homeList: state => state.homeList,
|
project: state => state.project
|
})
|
}
|
</script>
|
|
<style>
|
.flex-justify-center {
|
display: flex;
|
justify-content: center;
|
}
|
.flex-align-center {
|
display: flex;
|
align-items: center;
|
|
}
|
.z-swiper {
|
height: 90px;
|
margin: 8px;
|
border-radius: 8px;
|
background-image: linear-gradient(110.6deg, rgb(179, 157, 219) 7%, rgb(150, 159, 222) 47.7%, rgb(24, 255, 255) 100.6%);
|
color: #fff;
|
}
|
.home-list {
|
display: flex;
|
flex-direction: column;
|
height: 90px;
|
margin: 8px;
|
border-radius: 8px;
|
background-color: #f5f5f5;
|
}
|
.list-title {
|
display: flex;
|
height: 20px;
|
margin: 10px 10px;
|
/* background-color: #fff; */
|
}
|
.list-title-tag {
|
width: 6px;
|
height: 20px;
|
margin: 5px 5px;
|
border-radius: 8px;
|
background-color: #00aeec;
|
|
}
|
.list-detl {
|
display: flex;
|
flex-direction: row;
|
}
|
</style>
|