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

[vue] ElementUI怎么修改组件的默认样式? #400

Open
haizhilin2013 opened this issue Jun 20, 2019 · 10 comments
Open

[vue] ElementUI怎么修改组件的默认样式? #400

haizhilin2013 opened this issue Jun 20, 2019 · 10 comments
Labels
vue vue

Comments

@haizhilin2013
Copy link
Collaborator

[vue] ElementUI怎么修改组件的默认样式?

@haizhilin2013 haizhilin2013 added the vue vue label Jun 20, 2019
@wenyejie
Copy link

第一直接按照element默认修改主题的方式, 直接修改配置
第二直接覆盖样式

@desireYoo
Copy link

我一般做法为在组件外层定义类名,通过获取组件类名,在style里面(不设置scoped)添加新的样式,当然通过公共样式也未尝不可。
image

@yc2c222
Copy link

yc2c222 commented Jul 17, 2019

不必去掉scoped
.el-table >>> .el-table__header 用>>>穿透

@miqidian
Copy link

miqidian commented Aug 7, 2019

还有一种方法:.el-table /deep/{} 把要改的写在里面。

@Elisony
Copy link

Elisony commented Sep 26, 2019

/deep/穿甲弹

@zlqGitHub
Copy link

需要注意的是:直接拿出样式表中的class类来在局部页面中设置默认样式的时候,刷新页面后,会影响到其他相同类的默认样式。

@Shurangan
Copy link

方法一:/deep/
方法二:>>>
方法三:在外层添加一层div,设置自定义类名,再修改里边的样式, 格式.自定义类名 .需要修改的样式 {}。

@black1agoon
Copy link

不是修改主题theme就行了吗.... 当然简单点就/deep/

@miqidian
Copy link

miqidian commented Oct 11, 2022 via email

@Elisony
Copy link

Elisony commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue vue
Projects
None yet
Development

No branches or pull requests

9 participants