Element 主题修改
1、修改 src/styles/element-variables.scss里的配置样式。
2、执行根目录下的 theme-build.js
node theme-build.js
3、修改前需安装 Element-theme 插件
4、Element-theme使用 此工具用于自定义Element UI主题工具,但是已经很久没有维护。以下是踩坑过程:
安装 先安装 element-theme-chalk
npm i element-theme-chalk -D
继续安装 element-theme
npm i element-theme -D
注意一定要按此顺序安装,否则,element-theme 找不到主题相应的内容。
解决报错 ReferenceError: internalBinding is not defined**
5、网上的解决方法:
npm install natives@1.1.6
原因:gulp升级之后,去除了此依赖。旧代码需要自行安装。
但是,按此方法依然无法启动,依然有错误。
尝试使用 node.js 的方法来执行,按官网文档写js代码:
test.js:
// test.js var et = require('element-theme’);
// watch mode et.watch({ config: 'variables/path', out: 'output/path' })
// build et.run({ config: 'src/styles/element-variables.scss', out: 'theme/', minimize: false });
然后用命令行 node 执行此文件:
node test.js
此时能正常执行。