小程序开发中遇到hover-class奇怪的问题?

/* pages/viewc/viewc.wxss */
.outter {
  width: 200px;
  height: 200px;
  background: blue;
}
.outter .outter-hover {
  background: blueviolet;
}
<!–pages/viewc/viewc.wxml–>
<view class=’outter’ hover-class=’outter-hover’></view>
我们在写以上的wxss wxml 文件中。
.outter .outter-hover {
  background: blueviolet;
}
小程序中的 hover-class=’outter-hover’  却没有响应。
而我们改为如下却进行了响应!
.outter-hover {
  background: blueviolet;
}
.outter.outter-hover {
  background: blueviolet;
}
我们要注意两个class 之前的空格。小程序的IDE 对这个要求严格,应该底层对于这个有过滤。

发表评论