mirror of
https://gitee.com/wonderful-code/buildadmin
synced 2024-11-23 07:40:18 +00:00
feat:添加表单颜色选择和表格颜色显示
Signed-off-by: 懂不能懂 <295047320@qq.com>
This commit is contained in:
parent
95a3309df6
commit
f364e6dded
@ -24,6 +24,7 @@ export const inputTypes = [
|
||||
'file',
|
||||
'files',
|
||||
'icon',
|
||||
'color'
|
||||
]
|
||||
export type modelValueTypes = string | number | boolean | object
|
||||
|
||||
|
@ -375,6 +375,17 @@ export default defineComponent({
|
||||
})
|
||||
},
|
||||
],
|
||||
[
|
||||
'color',
|
||||
() => {
|
||||
return () =>
|
||||
createVNode(resolveComponent('el-color-picker'), {
|
||||
modelValue: props.modelValue,
|
||||
'onUpdate:modelValue': onValueUpdate,
|
||||
...props.attr,
|
||||
})
|
||||
},
|
||||
],
|
||||
[
|
||||
'editor',
|
||||
() => {
|
||||
|
@ -96,6 +96,7 @@ export default defineComponent({
|
||||
'remoteSelect',
|
||||
'city',
|
||||
'icon',
|
||||
'color'
|
||||
] // 不带独立label输入框
|
||||
let needLabelSlot = ['radio', 'checkbox', 'switch', 'array', 'image', 'images', 'file', 'files', 'editor'] // 需要独立label的输入框
|
||||
if (noNeedLabelSlot.includes(props.type)) {
|
||||
|
@ -90,7 +90,10 @@
|
||||
<div v-if="field.render == 'datetime'">
|
||||
{{ !fieldValue ? '-' : timeFormat(fieldValue, field.timeFormat ?? undefined) }}
|
||||
</div>
|
||||
|
||||
<!-- color -->
|
||||
<div v-if="field.render == 'color'">
|
||||
<div :style="{background:fieldValue}" class="el-color"></div>
|
||||
</div>
|
||||
<!-- customTemplate 自定义模板 -->
|
||||
<div
|
||||
v-if="field.render == 'customTemplate'"
|
||||
@ -305,4 +308,8 @@ const getTagType = (value: string, custom: any): TagProps['type'] => {
|
||||
.ml-6 + .el-button {
|
||||
margin-left: 6px;
|
||||
}
|
||||
.el-color{
|
||||
height:25px;
|
||||
width:100%
|
||||
}
|
||||
</style>
|
||||
|
Loading…
Reference in New Issue
Block a user