theme-custom
v1.0.1
Published
Vue 2 + Element UI 动态主题切换工具,支持主色及衍生色自动替换
Maintainers
Readme
theme-custom
Vue 2 + Element UI 动态主题切换工具,支持用户自定义主题色及衍生色自动同步更新。
安装
npm install theme-custom --save
# 或
yarn add theme-custom使用
直接调用changePrimaryTheme函数实现任意主题的切换。
只需要把 ColorPicker 颜色选择器🎨给到用户即可。
import { changePrimaryTheme } from 'theme-custom'
/** 调用
* '#E81414': 第一个参数为选中的主题色
* '#41b584': 第二个参数为当前的主题色,一般为sass变量定义
*/
changePrimaryTheme('#E81414', '#41b584')