uniapp小程序顶部导航下拉变样式

	<view class="topBg" :style="'padding-top:' + (titleHeight+5) + 'px'" :class="{'backegroundColor':hieghtTbg>0}">
			<view class="topHead">
				<image v-if="hieghtTbg<0" src="http://adminshop.qiuxiangjk.com/shopstatic/images/medicine/fanhui1.png" mode="" @click="golast"></image>
					<image v-if="hieghtTbg>0" src="http://adminshop.qiuxiangjk.com/shopstatic/images/medicine/fanhui.png" mode="" @click="golast"></image>
				<view v-if="hieghtTbg<0" class="Line"></view>
				<view  v-if="hieghtTbg>0"  class="LineT"></view>
				<image v-if="hieghtTbg<0" src="http://adminshop.qiuxiangjk.com/shopstatic/images/medicine/home1.png" mode=""  @click="homes"></image>
				<image  v-if="hieghtTbg>0"  src="http://adminshop.qiuxiangjk.com/shopstatic/images/medicine/home.png" mode="" @click="homes"></image>
			</view>
			<view class="topHeadR">
				<text class="title" :class="{'fontColor':hieghtTbg>0}" >用户主页</text>
			</view>
		</view>
	hieghtTbg: 0,
			}
		},

		//监听页面滚动
		onPageScroll(e) {
			this.hieghtTbg = e.scrollTop
		},

猜你喜欢

转载自blog.csdn.net/weixin_51426266/article/details/128661573