前言
我們都知道在vue中可以定義多個<style>,一般為了防止全局污染,我們會使用<style scoped>代表這里面的css樣式只在本頁面生效。
全局
這個當時測試是直接寫,沒有加層級,然后樣式沒生效,后面就直接刪除,在私有的里面進行穿透修改了!如果要測試最好加本頁面的大類,不然會污染全局!!!所以還是推薦私有穿透吧。
<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; } } }