uni-app

※前提条件:vue3 的uniapp开发

view组件用法 [edit]

例程 [edit]

<template>
	<view class="max" hover-class="box2-active">
		<view class="box" hover-class="box-active" hover-stop-propagation :hover-start-time="2000"
			:hover-stay-time="2000">我是一个大盒子哦</view>
	</view>
</template>

<style>
	.max {
		width: 200rpx;
		height: 200rpx;
		background-color: blue;
	}

	.box {
		width: 100rpx;
		height: 100rpx;
		background-color: #F0AD4E;
	}

	.box-active {
		background-color: #007AFF;
	}

	.box2-active {
		background-color: pink;
	}
</style>

hover-stop-propagationy [edit]

属性意思是阻止冒泡 点大盒子的时候小盒子不会变 反之亦然

hover-class="box-active" [edit]

指定按下去的样式类

也就是点击设置会变颜色

hover-start-time [edit]

按住后多久出现点击态,单位毫秒

hover-stay-time [edit]

手指松开后点击态保留时间,单位毫秒


Comment:



(画像の文字列を入力して下さい)

トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS