项目中使用了el-popover,但是想修改一下样式,一直不成功,先来看一下官方文档怎么说的
添加一个类名,string类型,ok,添加一个
<el-popover
placement="right"
width="400"
trigger="hover"
popper-class="my-popover"
>
去设置样式
<style lang="scss" scoped>
.my-popover{
padding:20px;
}
</style>
结果就是没有设置成功!
是不是因为scoped,不加scoped再试一下!
<style>
my-popover{
padding:10px 30px;
}
</style>
还是没有效果!!!
经过疯狂试验以及网上搜索!
最终写法是这样,.el-popover.my-popover 这种格式,前缀是.el-popover ,不然不生效。且不能加上scoped
<style>
.el-popover.my-popover{
padding:10px 30px;
}
</style>
修改成功!