效果图如下:

未收藏:

uni-app中 未收藏和已收藏功能展示

已收藏:

uni-app中 未收藏和已收藏功能展示

代码实现:

1 <view class="jichu">
2      <view class="name">xxx</view>
3      <image class="collection" src="../../../static/image/ic_weishoucang.png" v-show="showUpImg" @click="changeImg"></image>
4      <image class="collection" src="../../../static/image/yishoucang@2x.png" v-show="!showUpImg" @click="changeImg"></image>
5 </view>
1 data() {
2     return {
3         showUpImg:true
4         }
5 }
1 methods:{
2     changeImg:function(){
3             this.showUpImg = !this.showUpImg 
4     },   
5 }

即可

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-07-07
  • 2021-05-20
  • 2022-12-23
  • 2022-01-12
  • 2021-07-19
  • 2021-09-07
猜你喜欢
  • 2021-12-20
  • 2021-08-31
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2021-12-02
  • 2021-06-08
相关资源
相似解决方案