问题描述:
- 使用uniapp开微信发小程序,A页面引入了B自定义组件(components/top/index)
- 我想要修改B自定义组件(components/top/index)中的第三方组件(uView)样式,然后使用了/deep/、:v-deep 都均不生效
问题解决:
我在B自定义组件(components/top/index)中,添加这段代码styleIsolation: 'shared'就可以解决了样式穿透的问题,如下:
export default {
data() {
return {}
},
options: {
styleIsolation: 'shared', // 解除样式隔离
},
}