feat(easy-admin): dynamic theme color for xmSelect
- Replace static color codes with dynamic theme color retrieval - Use getComputedStyle to fetch the '--ea8-theme-main-color' variable - Update xmSelect instances in easy-admin.js and goods.js to use dynamic color
This commit is contained in:
@@ -94,17 +94,10 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
||||
},
|
||||
})
|
||||
|
||||
let colors = [
|
||||
'#f10f0f', // 红色
|
||||
'#ffaf00', // 橙色
|
||||
'#FF69B4', // 猛男粉
|
||||
'#0087ff', // 蓝色
|
||||
'#00ff00', // 青青草原
|
||||
];
|
||||
var demo1 = xmSelect.render({
|
||||
el: '#demo1',
|
||||
name: 'xxx', // form表单提交的name
|
||||
theme: {color: colors[Math.floor(Math.random() * colors.length)]},
|
||||
theme: {color: getComputedStyle(document.documentElement).getPropertyValue('--ea8-theme-main-color') || '#16b777'},
|
||||
data: [
|
||||
{name: 'Make', value: 1},
|
||||
{name: 'PHP', value: 2},
|
||||
@@ -123,17 +116,10 @@ define(["jquery", "easy-admin"], function ($, ea) {
|
||||
},
|
||||
})
|
||||
|
||||
let colors = [
|
||||
'#f10f0f', // 红色
|
||||
'#ffaf00', // 橙色
|
||||
'#FF69B4', // 猛男粉
|
||||
'#0087ff', // 蓝色
|
||||
'#00ff00', // 青青草原
|
||||
];
|
||||
var demo1 = xmSelect.render({
|
||||
el: '#demo1',
|
||||
name: 'xxx', // form表单提交的name
|
||||
theme: {color: colors[Math.floor(Math.random() * colors.length)]},
|
||||
theme: {color: getComputedStyle(document.documentElement).getPropertyValue('--ea8-theme-main-color') || '#16b777'},
|
||||
data: [
|
||||
{name: 'Make', value: 1},
|
||||
{name: 'PHP', value: 2, selected: true,},
|
||||
|
||||
@@ -879,7 +879,8 @@ define(["jquery", "tableSelect", "miniTheme", "xmSelect", "lazyload"], function
|
||||
})
|
||||
init.xmSelectModel[index] = xmSelect.render({
|
||||
el: '.xmSelect-' + index, language: 'zn', data: keysArray, name: index,
|
||||
filterable: true, paging: true, pageSize: 10, theme: {color: '#16b777'}, toolbar: {show: true},
|
||||
filterable: true, paging: true, pageSize: 10, toolbar: {show: true},
|
||||
theme: {color: getComputedStyle(document.documentElement).getPropertyValue('--ea8-theme-main-color') || '#16b777'}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user