elementui图标偶尔乱码问题

1. 卸载sass,安装node-sass

安装node-sass

npm install node-sass@5.0.0 -D
2. element主题修改文件element-variables.scss,引入的样式文件分开引入

variables.scss去掉icon.css文件引入

@import '~element-ui/packages/theme-chalk/src/pagination.scss';
@import '~element-ui/packages/theme-chalk/src/dialog.scss';
@import '~element-ui/packages/theme-chalk/src/autocomplete.scss';
@import '~element-ui/packages/theme-chalk/src/dropdown.scss';
@import '~element-ui/packages/theme-chalk/src/dropdown-menu.scss';
@import '~element-ui/packages/theme-chalk/src/dropdown-item.scss';
@import '~element-ui/packages/theme-chalk/src/menu.scss';
@import '~element-ui/packages/theme-chalk/src/submenu.scss';
@import '~element-ui/packages/theme-chalk/src/menu-item.scss';
@import '~element-ui/packages/theme-chalk/src/menu-item-group.scss';
@import '~element-ui/packages/theme-chalk/src/input.scss';
@import '~element-ui/packages/theme-chalk/src/input-number.scss';
@import '~element-ui/packages/theme-chalk/src/radio.scss';
@import '~element-ui/packages/theme-chalk/src/radio-group.scss';
@import '~element-ui/packages/theme-chalk/src/radio-button.scss';
@import '~element-ui/packages/theme-chalk/src/checkbox.scss';
@import '~element-ui/packages/theme-chalk/src/checkbox-button.scss';
@import '~element-ui/packages/theme-chalk/src/checkbox-group.scss';
@import '~element-ui/packages/theme-chalk/src/switch.scss';
@import '~element-ui/packages/theme-chalk/src/select.scss';
@import '~element-ui/packages/theme-chalk/src/button.scss';
@import '~element-ui/packages/theme-chalk/src/button-group.scss';
@import '~element-ui/packages/theme-chalk/src/table.scss';
@import '~element-ui/packages/theme-chalk/src/table-column.scss';
@import '~element-ui/packages/theme-chalk/src/date-picker.scss';
@import '~element-ui/packages/theme-chalk/src/time-select.scss';
@import '~element-ui/packages/theme-chalk/src/time-picker.scss';
@import '~element-ui/packages/theme-chalk/src/popover.scss';
@import '~element-ui/packages/theme-chalk/src/tooltip.scss';
@import '~element-ui/packages/theme-chalk/src/message-box.scss';
@import '~element-ui/packages/theme-chalk/src/breadcrumb.scss';
@import '~element-ui/packages/theme-chalk/src/breadcrumb-item.scss';
@import '~element-ui/packages/theme-chalk/src/form.scss';
@import '~element-ui/packages/theme-chalk/src/form-item.scss';
@import '~element-ui/packages/theme-chalk/src/tabs.scss';
@import '~element-ui/packages/theme-chalk/src/tab-pane.scss';
@import '~element-ui/packages/theme-chalk/src/tag.scss';
@import '~element-ui/packages/theme-chalk/src/tree.scss';
@import '~element-ui/packages/theme-chalk/src/alert.scss';
@import '~element-ui/packages/theme-chalk/src/notification.scss';
@import '~element-ui/packages/theme-chalk/src/slider.scss';
@import '~element-ui/packages/theme-chalk/src/loading.scss';
@import '~element-ui/packages/theme-chalk/src/row.scss';
@import '~element-ui/packages/theme-chalk/src/col.scss';
@import '~element-ui/packages/theme-chalk/src/upload.scss';
@import '~element-ui/packages/theme-chalk/src/progress.scss';
@import '~element-ui/packages/theme-chalk/src/spinner.scss';
@import '~element-ui/packages/theme-chalk/src/message.scss';
@import '~element-ui/packages/theme-chalk/src/badge.scss';
@import '~element-ui/packages/theme-chalk/src/card.scss';
@import '~element-ui/packages/theme-chalk/src/rate.scss';
@import '~element-ui/packages/theme-chalk/src/steps.scss';
@import '~element-ui/packages/theme-chalk/src/step.scss';
@import '~element-ui/packages/theme-chalk/src/carousel.scss';
@import '~element-ui/packages/theme-chalk/src/scrollbar.scss';
@import '~element-ui/packages/theme-chalk/src/carousel-item.scss';
@import '~element-ui/packages/theme-chalk/src/collapse.scss';
@import '~element-ui/packages/theme-chalk/src/collapse-item.scss';
@import '~element-ui/packages/theme-chalk/src/cascader.scss';
@import '~element-ui/packages/theme-chalk/src/color-picker.scss';
@import '~element-ui/packages/theme-chalk/src/transfer.scss';
@import '~element-ui/packages/theme-chalk/src/container.scss';
@import '~element-ui/packages/theme-chalk/src/header.scss';
@import '~element-ui/packages/theme-chalk/src/aside.scss';
@import '~element-ui/packages/theme-chalk/src/main.scss';
@import '~element-ui/packages/theme-chalk/src/footer.scss';
@import '~element-ui/packages/theme-chalk/src/timeline.scss';
@import '~element-ui/packages/theme-chalk/src/timeline-item.scss';
@import '~element-ui/packages/theme-chalk/src/link.scss';
@import '~element-ui/packages/theme-chalk/src/divider.scss';
@import '~element-ui/packages/theme-chalk/src/image.scss';
@import '~element-ui/packages/theme-chalk/src/calendar.scss';
@import '~element-ui/packages/theme-chalk/src/backtop.scss';
@import '~element-ui/packages/theme-chalk/src/infinite-scroll.scss';
@import '~element-ui/packages/theme-chalk/src/page-header.scss';
@import '~element-ui/packages/theme-chalk/src/cascader-panel.scss';
@import '~element-ui/packages/theme-chalk/src/avatar.scss';
@import '~element-ui/packages/theme-chalk/src/drawer.scss';
@import '~element-ui/packages/theme-chalk/src/popconfirm.scss';
@import '~element-ui/packages/theme-chalk/src/common/transition.scss';

main.js中引入icon.css

import 'element-ui/lib/theme-chalk/icon.css'
相关推荐
I_Am_Me_9 分钟前
【JavaEE进阶】 JavaScript
开发语言·javascript·ecmascript
雯0609~16 分钟前
网页F12:缓存的使用(设值、取值、删除)
前端·缓存
℘团子এ20 分钟前
vue3中如何上传文件到腾讯云的桶(cosbrowser)
前端·javascript·腾讯云
学习前端的小z25 分钟前
【前端】深入理解 JavaScript 逻辑运算符的优先级与短路求值机制
开发语言·前端·javascript
前端百草阁1 小时前
【TS简单上手,快速入门教程】————适合零基础
javascript·typescript
彭世瑜1 小时前
ts: TypeScript跳过检查/忽略类型检查
前端·javascript·typescript
FØund4041 小时前
antd form.setFieldsValue问题总结
前端·react.js·typescript·html
Backstroke fish1 小时前
Token刷新机制
前端·javascript·vue.js·typescript·vue
zwjapple1 小时前
typescript里面正则的使用
开发语言·javascript·正则表达式
小五Five1 小时前
TypeScript项目中Axios的封装
开发语言·前端·javascript