帖子
帖子
用户
博客
课程
显示全部楼层
286
帖子
2
勋章
7万+
Y币

[开发工具] 发现一个比较复杂的样式不清除的bug

[复制链接]
发表于 2021-11-29 16:17:51
经过测试, border-radius 中的数值无法清除, 额外在 其他样式中写了 border-radius:0; 这种写法也是无效
同样的代码,在H5,及小程序端能正常使用, ios及安卓都有这个问题

下面是碰到错误的示例图

超级截屏_20211129_161553.png


下面是代码:


  1. <template>
  2.         <view class="_page">
  3.                 <scroll-view scroll-y="true" show-scrollbar="false" bounces="false" class="b-fff">
  4.                         <view v-for="(item,index) in list"
  5.                         :key="index"  
  6.                         :class="'height-59 ' +
  7.                         (index == select_index ? 'b-fff ':'b-F2F2F7 ') +
  8.                         (index == select_index - 1 ? 'right-down-border-radius ':'') +
  9.                         (index == select_index + 1 ? 'right-top-border-radius ':'')"  
  10.                         @click="select(index)">
  11.                         <text>{item.title}</text>
  12.                         </view>
  13.                 </scroll-view>
  14.         </view>
  15. </template>
  16. <script>
  17. export default {
  18.         name: 'directory-list',
  19.         apiready() {//like created

  20.         },
  21.         data() {
  22.                 return {
  23.                         select_index: 0,
  24.                         list: [{
  25.                                 title: "一级类目",
  26.                                 id: 0
  27.                         }, {
  28.                                 title: "一级类目",
  29.                                 id: 1
  30.                         }, {
  31.                                 title: "一级类目",
  32.                                 id: 2
  33.                         }, {
  34.                                 title: "一级类目",
  35.                                 id: 3
  36.                         }, {
  37.                                 title: "一级类目",
  38.                                 id: 4
  39.                         }, {
  40.                                 title: "一级类目",
  41.                                 id: 5
  42.                         }, {
  43.                                 title: "一级类目",
  44.                                 id: 6
  45.                         }]
  46.                 }
  47.         },
  48.         methods: {
  49.                 select(index) {
  50.                         this.data.select_index = index;
  51.                         // this.fire("checked", this.props.list[index]);
  52.                 }
  53.         }
  54. }
  55. </script>

  56. <style scoped>
  57. .b-F2F2F7 {
  58.         background: #f2f2f7;
  59. }
  60. .b-fff {
  61.         background: #fff;
  62. }
  63. .active-icon {
  64.         width: 3px;
  65.         height: 13px;
  66.         position: absolute;
  67.         left: 0;
  68.         top: 0;
  69.         bottom: 0;
  70.         margin: auto;
  71. }
  72. .active-text {
  73.         font-family: PingFangSC-Medium, PingFang SC;
  74.         font-weight: 500;
  75. }
  76. .nomarl-text {
  77.         font-family: PingFangSC-Regular, PingFang SC;
  78.         font-weight: 400;
  79. }
  80. .clear {
  81.         border-radius: 0;
  82. }
  83. .right-down-border-radius {
  84.         border-radius: 0 0 10px 0;
  85. }
  86. .right-top-border-radius {
  87.         border-radius: 0 10px 0 0;
  88. }
  89. .height-40 {
  90.         height: 40px;
  91. }
  92. .height-20 {
  93.         height: 20px;
  94. }
  95. .text {
  96.         font-size: 14px;
  97.         line-height: 20px;
  98. }
  99. .height-59 {
  100.         height: 59px;
  101.         width: 100%;
  102. }
  103. ._page {
  104.         width: 86px;
  105.         height: 100%;
  106.         background: #f2f2f7;
  107. }
  108. </style>
复制代码






10
帖子
1
勋章
5683
Y币
已经反馈给相关技术。
286
帖子
2
勋章
7万+
Y币
感谢大佬的辛苦回复,已经找到暂时解决这个bug 的 临时方法, border-radius 当参数从 大于0 的改变为0 的时候, 是不生效的,但是当改变为一个 趋近于0 的一个值,那么是生效的
杨永安 · 2021-11-30 11:34已经反馈给相关技术。
您需要登录后才可以回帖 登录

本版积分规则