- 以前学的,忘了,跪求解答,首页选项怎么做?
求求大家帮我看看,错在哪里了?结构文件index.wxml <view> <scroll-view class="left-navbar" scroll-y> <view wx:for="{{navitems}}" class="{{curNav == index? `active` : ``}}" bindtop="leftclick" data-index="{{index}}">{{item}}</view> </scroll-view> <scroll-view class="right" scroll-y> <image style="height: 25%;" src="/pages/images/4.jpg"></image> <view wx:for="{{navitems}}">{{item}}</view> </scroll-view> </view> 格式文件index.wxss .left-navbar view{ height: 80rpx; line-height: 80rpx; text-align: center; } .active{ background-color: #fff; color: red; font-size: 17px; } .right { position: absolute; right: 0; width: 75%; height: 100%; background-color: rgb(241, 203, 209); font-size: 15px; } 方法文件index.js Page({ data: { navitems: [`手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, `手表`, ] }, curNav:0, leftclick:function(e){ var index = e.target.dataset.index console.log(index) this.setData({ curNav:index }) },
2022-03-11 - 渲染错误,跪求解答,新人小白?
请老师们帮我看看,怎么就显示不出来图片,提示渲染错误 wxml <swiper class="swiperclass" indicator-dots autoplay interval="10000" duration="1000"> <swiper-item> <view class="img" style="background-image: url(`/images/1.jpg`)"></view> </swiper-item> wxss page{ width: 100%; height: 100%; } .swiperclass{ height: 30%; } .img{ height: 100%; background-size: contain; }
2022-03-10