vue scoped 解決樣式不生效問題

對於添加樣式不能影響子組件樣式的情況使用:>>>

<style scoped>
    .sti-inline{
        display: inline;
    }
    .sti-searchform form .sti-reset-margin{
        margin-bottom:0px;
    }
    .sti-searchform{
        line-height: 1;
    }
    .sti-searchform.searchform{
        margin-bottom: 10px;
    }
    .phone >>> .el-form-item__label, label{
          padding-left: 0 !important;
          padding-right: 0 !important;
          width: 115px !important;
    }
    .phone >>> .el-form-item__content{
          margin-left: 115px !important;
    }
.ant-tabs /deep/ .ant-tabs-left-content {

    padding-left: 12px;

}
</style>

說明參考:

https://vue-loader.vuejs.org/zh/guide/scoped-css.html#子組件的根元素

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章