在組件的js中寫:
options: {
styleIsolation: 'apply-shared',
},
css:
:host {
display: block;
}
在頁面html中:
給包裹組件的view寫class:如class=“box”
css中:(box1是組件中的類)
.box .box1{
background:red
}