在vue中写<style lang="scss" scoped>
时候都要加上这个 scoped
用于避免全局污染
但是加上了scoped
会导致无法修改 vant 框架组件中本身的样式但是scoped
我们不能去掉
即使写不了vant中的样式我们也不能去掉那么在怎么不去掉的情况下实现样式呢?
如果有scss的话只要在原有的样式类前面加 /deep/
即可
/deep/ .van-cell{
background: #F39894;
color: white;
}
/deep/ .van-icon::before{
color: white;
}
这样就可以在有scoped的情况下 也能修改组件的样式了