#
Your Name
2022-08-17 ecbb13047dbf7918d61e60ff264125ba71cb3840
pages/demo/index.vue
@@ -1,14 +1,13 @@
<template>
   <view>
      <view class="home-nav">
         <view class="home-nav-item" v-for="(item,index) in navs">
         <view class="home-nav-item" v-for="(item,index) in navs" @click="click(index)" :class="item.clicked">
            <view class="nav-icon">
               <uni-icons :type="item.icon" size="60"></uni-icons>
            </view>
            <view class="nav-text">
               {{item.text}}
            </view>
         </view>
      </view>
   </view>
@@ -21,25 +20,37 @@
            navs:[
               {
                  text:'入库',
                  icon:'download'   ,
                  icon:'download',
                  clicked:''
               },
               {
                  text:'出库',
                  icon:'upload'   ,
                  icon:'upload',
                  clicked:''
               },
               {
                  text:'盘点',
                  icon:'compose'   ,
                  icon:'compose',
                  clicked:''
               },
               {
                  text:'退出登录',
                  icon:'close'   ,
                  icon:'close',
                  clicked:''
               },
               ]
               ],
         }
      },
      methods: {
         click(index) {
            this.navs[index].clicked = 'grey'
            setTimeout(()=>{
               this.navs[index].clicked = ''
            },100)
         }
      }
   }
</script>
@@ -73,4 +84,7 @@
      margin-bottom: 20%;
      text-align: center;
   }
   .grey {
      background-color: #dcdcdc;
   }
</style>