Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修改element-ui组件默认样式 #194

Open
TieMuZhen opened this issue May 7, 2022 · 0 comments
Open

修改element-ui组件默认样式 #194

TieMuZhen opened this issue May 7, 2022 · 0 comments
Labels

Comments

@TieMuZhen
Copy link
Owner

我们在使用element-ui的时候经常会需要修改组件默认样式。有的时候element提供的默认的样式不能满足项目的需要,就需要我们队标签的样式进行修改,但是发现修改的样式不起作用

(1)less 和 sass 中都提供了 /deep/ 深度穿透选择器,此时我们依旧可以保留scoped属性而不必担心样式污染。

<style lang="less" scoped>
    /deep/ .el-table--body {}
</style>

(2)vue中提供了深度选择器>>>,但是sass等工具还无法识别他,需要写在单独的style里面

<style scoped>
    // 需要覆盖的样式
    .wrapper >>> .el-table--body {}
</style>
<style lang="less" scoped>
    // 本地样式
</style>
@TieMuZhen TieMuZhen added the Vue label May 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant