微信小程序的view容器简单记录笔记

view容器和html里面的div差不多

view容器里面,有一下几个属性。

  1. hover-class     String 类型   指定按下去的样式类。 当为none时,没有样式。
  2. hober-stop-propagation Boolean类型 指定是否阻止本节点的祖先节点出现点击态。
  3. hover-stay-time 毫秒   按住后多久出现点击态。
  4. hover-stay-time 毫秒   手指松开后,点击态保留时间。
  5. aria-role  标识元素的作用, 没有多大用
  6. aria-label 元素的额外描述 没多大用。

以下是我做的一个demo。

wxml文件

<view class="first-view" hover-class="first-level">
一级里面的内容
<view class="body" hover-class='after-body' hover-stop-propagation="true" hover-start-time='5000' hover-stay-time="5000" aria-label="给新手看的,写的">
你好
</view>
</view>

css文件

/* pages/index/index.wxss */

.first-view {
    background-color: aliceblue;
    display: block;
    position: absolute;
}

.first-level {
    background-color: bisque;
}

.body {
    background-color: aliceblue;
     100%;
    height: 100%;
}

.after-body {
    background-color: aquamarine
}
原文地址:https://www.cnblogs.com/fuckingPangzi/p/10441222.html