theme_dj
v1.0.10
Published
brieftime
Downloads
37
Readme
theme_dj
theme_dj 主题处理包含了element-plus的主题设置
安装
// npm
npm i theme_dj
// yarn
yarn add theme_dj
// pnpm
pnpm i theme_dj快速使用
import {setThemeData} from "theme_dj";设置主题
let themeData=[
{primary:'#409eff', light:'#1B3651', dark:'#012447'},
{primary:'#409eff', light:'#fff', dark:''},
{primary:'#103a8c', light:'#fff', dark:'#000'},
{primary:'#103a8c', light:'#000', dark:'#fff'},
{primary:'#1d609d', light:'#8307a8', dark:'#00407e'},
{primary:'#38bd14', light:'#0036ea', dark:'#9f450a'},
{primary:'#eeeeed', light:'#5d4343', dark:'#502a11'},
]
let index=ref(3);//当前选中的数据
function switchTheme(type=0) {
setThemeData(themeData[type])
}
onMounted(()=>{
switchTheme(index.value)
})方法有
setColor //设置全局变量颜色
colorToLen //补充颜色长度hex
colorMix //色阶取值,从第一个色阶到第二个色阶
setTheColorScale //返回需要设置的数据
setThemeData //设置数据值
