mpvue——修改第三方组件样式

前言

 

咱们都知道在vue中能够定义多个<style>,通常为了防止全局污染,咱们会使用<style scoped>表明这里面的css样式只在本页面生效。css

 

全局

这个当时测试是直接写,没有加层级,而后样式没生效,后面就直接删除,在私有的里面进行穿透修改了!若是要测试最好加本页面的大类,否则会污染全局!!!因此仍是推荐私有穿透吧。vue

<style >

</style>

 

私有

使用/deep/进行穿透,在mpvue中使用>>>穿透,编译会报错测试

.form-area {
      width: 100%;
      bottom: 1.88rem;
      .form-wrap {
        width: 340px;
        position: relative;
        left: 20px;
        .form-item {
          width: 100%;
          height: 50px;
          margin: 5px 0;
          border-radius: 10px;
          background-color: #fff;
        /deep/.van-cell {
            width: 240px !important;
            position: none !important;
          }
        }
      }
相关文章
相关标签/搜索