1,在选择器前面加个Id选择器来限制

<template>
<div >

</div>
</template>
<style>
#warp .el-dialog{
width:800px
}
</style>
2,使用/deep/

在vue中,我们为了避免父组件的样式影响到子组件的样式,会在style中加<style scoped>,这样父组件中如果有跟子组件相同的class名称或者使用选择器的时候,就不会影响到子组件的样式。如果让父组件的样影响到子组件,那么我们就需要/deep/

<template>
<div >

</div>
</template>
<style scoped>
/deep/ .el-dialog{
width:800px
}
</style>
当然了把 /deep/ 换成 >>>,也可以达到同样的效果 

相关文章:

  • 2021-11-17
  • 2021-11-13
  • 2021-11-19
  • 2021-11-19
  • 2021-12-29
  • 2018-04-21
  • 2021-11-19
猜你喜欢
  • 2021-06-19
  • 2021-11-19
  • 2021-05-01
  • 2021-11-11
  • 2021-12-03
  • 2021-11-19
  • 2021-12-13
  • 2021-10-12
相关资源
相似解决方案