跳到主要内容
版本:1.x

View

视图容器

属性

属性名类型默认值说明
hoverClassStringnone指定按下去的样式类。当 hover-class='none' 时,没有点击态效果
hoverStartTimeNumber50按住后多久出现点击态,单位毫秒
hoverStayTimeNumber400手指松开后点击态保留时间,单位毫秒
hoverStopPropagationBooleanfalse指定是否阻止本节点的祖先节点出现点击态

各端支持度

属性微信小程序H5ReactNative百度小程序支付宝小程序抖音小程序
hoverClass(支持 hoverStyle 属性,但框架未支持 hoverClass)
hoverStartTime
hoverStayTime
hoverStopPropagationx
示例:
import Taro, { Component } from '@tarojs/taro'
import { View, Text } from '@tarojs/components'

export default class PageView extends Component {
constructor() {
super(...arguments)
}

render() {
return (
<View className='components-page'>
<Text>flex-direction: row 横向布局</Text>
<View className='flex-wrp' style='flex-direction:row;'>
<View className='flex-item demo-text-1'/>
<View className='flex-item demo-text-2'/>
<View className='flex-item demo-text-3'/>
</View>
<Text>flex-direction: column 纵向布局</Text>
<View className='flex-wrp' style='flex-direction:column;'>
<View className='flex-item flex-item-V demo-text-1'/>
<View className='flex-item flex-item-V demo-text-2'/>
<View className='flex-item flex-item-V demo-text-3'/>
</View>
</View>
)
}
}