feat: add dict color
parent
e1341c187a
commit
d0ad54b4d7
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { onMounted, onUpdated, PropType, ref } from 'vue'
|
import { onMounted, onUpdated, PropType, ref } from 'vue'
|
||||||
import { getDictOptions, DictDataType } from '@/utils/dict'
|
import { getDictOptions, DictDataType } from '@/utils/dict'
|
||||||
|
import { isHexColor } from '@/utils/color'
|
||||||
import { ElTag } from 'element-plus'
|
import { ElTag } from 'element-plus'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: {
|
type: {
|
||||||
|
@ -38,7 +39,7 @@ onUpdated(() => {
|
||||||
:disable-transitions="true"
|
:disable-transitions="true"
|
||||||
:key="dictData?.value + ''"
|
:key="dictData?.value + ''"
|
||||||
:type="dictData?.colorType"
|
:type="dictData?.colorType"
|
||||||
:color="dictData?.cssClass"
|
:color="dictData?.cssClass && isHexColor(dictData?.cssClass) ? dictData?.cssClass : ''"
|
||||||
>
|
>
|
||||||
{{ dictData?.label }}
|
{{ dictData?.label }}
|
||||||
</ElTag>
|
</ElTag>
|
||||||
|
|
|
@ -205,7 +205,7 @@ const getPageConfig = (options: XTableProps) => {
|
||||||
if (isBoolean(pagination)) {
|
if (isBoolean(pagination)) {
|
||||||
options.pagerConfig = {
|
options.pagerConfig = {
|
||||||
border: false, // 带边框
|
border: false, // 带边框
|
||||||
background: true, // 带背景颜色
|
background: false, // 带背景颜色
|
||||||
perfect: false, // 配套的样式
|
perfect: false, // 配套的样式
|
||||||
pageSize: 10, // 每页大小
|
pageSize: 10, // 每页大小
|
||||||
pagerCount: 7, // 显示页码按钮的数量
|
pagerCount: 7, // 显示页码按钮的数量
|
||||||
|
|
|
@ -95,7 +95,7 @@ VXETable.setup({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
pager: {
|
pager: {
|
||||||
background: true,
|
background: false,
|
||||||
autoHidden: false,
|
autoHidden: false,
|
||||||
perfect: true,
|
perfect: true,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
|
|
Loading…
Reference in New Issue