From 1c3348591f1529df57a844385af0ade821e67566 Mon Sep 17 00:00:00 2001 From: whycq <10027870+whycq@user.noreply.gitee.com> Date: 星期四, 18 八月 2022 13:53:09 +0800 Subject: [PATCH] # --- pages/demo/index.vue | 36 +++++++++++++++++++++++++++--------- 1 files changed, 27 insertions(+), 9 deletions(-) diff --git a/pages/demo/index.vue b/pages/demo/index.vue index d96117d..51cf379 100644 --- a/pages/demo/index.vue +++ b/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" @touchstart="touch(index)" @touchend="touchend(index)"> <view class="nav-icon"> - <uni-icons :type="item.icon" size="60"></uni-icons> + <uni-icons :type="item.icon" size="60" color="#6c6c6c"></uni-icons> </view> <view class="nav-text"> {{item.text}} </view> - </view> </view> </view> @@ -21,25 +20,41 @@ 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) { + + }, + touch(index) { + this.navs[index].clicked = 'grey' + // setTimeout(()=>{ + + // },100) + }, + touchend(index) { + this.navs[index].clicked = '' + } } } </script> @@ -73,4 +88,7 @@ margin-bottom: 20%; text-align: center; } + .grey { + background-color: #dcdcdc; + } </style> \ No newline at end of file -- Gitblit v1.9.1