uniapp H5 touchstart touchend 切换背景会失效,或者没用

uniapp H5 touchstart touchend 切换背景会失效,或者没用

  1. 直接上代码 (使用 class 以及 hover-class来设置样式)

  2. class 设置默认的背景图或者样式

  3. hover-class 来设置按下的背景图 或者样式

    抬起
    uniapp H5 touchstart touchend 切换背景会失效,或者没用_第1张图片
    按下
    uniapp H5 touchstart touchend 切换背景会失效,或者没用_第2张图片

<view class="mp_zoom_size ZoomReduceIcon" hover-class="touchZoomReduceIcon">
</view>

<style lang="scss" scoped>
	.touchZoomReduceIcon {
		background-image: url('../../static/img/zoom_reduce_press.png') !important;
		background-size: 100% 100%;
		background-repeat: no-repeat;
	}
	
	.ZoomReduceIcon {
		background-image: url('../../static/img/zoom_reduce.png') !important;
		background-size: 100% 100%;
		background-repeat: no-repeat;
	}
</style>
  1. 搞定!(日常记录)

你可能感兴趣的:(vue.js,前端,javascript)