Ant Design Pro 组件踩坑记录 之 antd5 360浏览器适配

482 阅读2分钟

antv5

最近项目用到了新手指引,用了antV5的 Tour组件, 测试的时候发现360浏览器不兼容这个组件的样式,样式是乱的,改meta的方法试过了没有用,我就直接复制了一份tour原来的样式然后在使用的时候引用。

样式如下
@import '~antd/es/style/themes/default.less';

.wrapper {
  min-height: 100%;
  padding: 15px 15px 0 15px;
  background-color: #f3f3f4;
}


.card-box {
  width: 100%;
  border-radius: 6px;
 
  &.record-card-box {
    position: relative;

    :global {
      .ant-card-head {
        position: absolute;
        top: 5px;
        left: 0;
        z-index: 1;
      }

      .ant-card-body {
        padding: 0 12px;
      }
    }
  }

  :global {
    .ant-tabs-tab-btn {
      text-shadow: none !important;
    }
    .ant-card-head {
      padding-left: 36px;
      border-bottom: 0;
    }

    .ant-card-body {
      max-height: 111px;
    }

    .ant-tabs-top > .ant-tabs-nav::before {
      border-bottom: 0;
    }

    .ant-tabs-nav .ant-tabs-tab {
      font-size: 16px;
    }

    .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn {
      color: #000;
    }

    .ant-tabs-ink-bar {
      height: 5px !important;
    }

    .ant-pro-table.table-card-wrapper {
      margin: 0 -12px;
      padding: 0;
    }
  }
}

.no-data-card-box {
  :global {
    .ant-card-body {
      max-height: none;
    }
  }
}

.tag-item {
  padding: 10px 15px;
  color: #000;
  font-size: 14px;
  background: #f9fcfe;
  border: 1px solid #d3edff;
  border-radius: 10px;
  cursor: default;
}

/* 空 */
.blank {
  display: flex;
  flex-direction: column;
  gap: 10px;
  color: #ddeafd;
  font-size: 14px;
  text-align: center;
}

.blank-icon {
  height: 69px;
  background-image: url('../../../../statics/images/portal/blank.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

/* 备案 */
.filling-box {
  display: flex;
  justify-content: center;
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  transform: scaleY(-1); // 滚动条放到顶部
}

.filling-box::-webkit-scrollbar {
  height: 6px;
}

.filling-tag-box {
  display: inline-flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: flex-start;
  padding-top: 10px;
  transform: scaleY(-1);
}

.filing-tag-item {
  width: 256px;
  margin-bottom: 8px;
}
.filing-company {
  height: auto !important;
  margin-top: 10px;
  padding-top: 10px;
  opacity: 1 !important;
}
.filing-icon {
  width: 55px;
  height: 55px;
  background: #e9f6ff;
  border-radius: 50%;
}

.filing-title {
  display: inline-block;
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filing-tip {
  font-size: 12px;

  :global {
    a {
      color: @primary-color;
    }
  }
}

.filing-company {
  display: flex;
  max-width: 230px;
  height: 0;
  overflow: hidden;
  opacity: 0;
  transition: all 0.1s ease;
}

.filing-company-item {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #d1ecff;
  border-radius: 12px;
  cursor: pointer;

  &:hover {
    color: #fff;
    background: #438bf1;
    border: 1px solid #006aff;
  }
}



// 轮播图样式
.swiper-box {
  position: relative;
  width: 35vw;
  min-width: 35vw;
  margin: 0 auto;
  .prev,
  .next {
    position: absolute;
    top: 29px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    &:hover {
      opacity: 0.8;
    }
  }

  .prev {
    left: -35px;
  }

  .next {
    right: -35px;
    transform: rotate(180deg);
  }

  .item {
    width: 256px;
  }
  :global {
    .swiper-slide {
      width: auto !important;
    }
  }
}
// /* 表格查询下拉框宽度自适应 */
.tableSelectDropBox {
  width: auto !important;
}