#
Your Name
2022-08-17 035f98facdf0036ee06d0f1bac43e4ea2b889e95
pages/demo/index.vue
@@ -1,11 +1,94 @@
<template>
   <view>
      <view class="home-nav">
         <view class="home-nav-item" v-for="(item,index) in navs" @click="click(index)" :class="item.clicked" @touchstart="touch(index)" @touchend="touchend(index)">
            <view class="nav-icon">
               <uni-icons :type="item.icon" size="60" color="#6c6c6c"></uni-icons>
            </view>
            <view class="nav-text">
               {{item.text}}
            </view>
         </view>
      </view>
   </view>
</template>
<script>
   export default{
      data() {
         return {
            navs:[
               {
                  text:'入库',
                  icon:'download',
                  clicked:''
               },
               {
                  text:'出库',
                  icon:'upload',
                  clicked:''
               },
               {
                  text:'盘点',
                  icon:'compose',
                  clicked:''
               },
               {
                  text:'退出登录',
                  icon:'close',
                  clicked:''
               },
               ],
         }
      },
      methods: {
         click(index) {
         },
         touch(index) {
            this.navs[index].clicked = 'grey'
            // setTimeout(()=>{
            // },100)
         },
         touchend(index) {
            this.navs[index].clicked = ''
         }
      }
   }
</script>
<style>
   .home-nav {
      width: 100%;
   }
   .home-nav-item {
      width: 33.33%;
      height: 0;
      padding-bottom: 33.33%;
      margin-top: 1%;
      border-bottom: 1px solid #cbcbcb;
      border-right: 1px solid #cbcbcb;
      display: inline-block;
   }
   .home-nav-item:first-child {
   }
   .nav-icon {
      width: 60%;
      height: 0;
      padding-bottom: 60%;
      margin: 10% auto;
      text-align: center;
   }
   .nav-text {
      width: 100%;
      height: 0;
      margin-bottom: 20%;
      text-align: center;
   }
   .grey {
      background-color: #dcdcdc;
   }
</style>