mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
fix: 修复listClass为空时未显示Bug.
This commit is contained in:
@ -1,6 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, useAttrs } from 'vue';
|
import { computed } from 'vue';
|
||||||
import type { TagProps } from 'naive-ui';
|
|
||||||
import { useDict } from '@/hooks/business/dict';
|
import { useDict } from '@/hooks/business/dict';
|
||||||
import { isNotNull } from '@/utils/common';
|
import { isNotNull } from '@/utils/common';
|
||||||
|
|
||||||
@ -21,8 +20,6 @@ const props = withDefaults(defineProps<Props>(), {
|
|||||||
value: () => []
|
value: () => []
|
||||||
});
|
});
|
||||||
|
|
||||||
const attrs = useAttrs() as TagProps;
|
|
||||||
|
|
||||||
const dictTagData = computed<Api.System.DictData[]>(() => {
|
const dictTagData = computed<Api.System.DictData[]>(() => {
|
||||||
if (props.dictData) {
|
if (props.dictData) {
|
||||||
return [props.dictData];
|
return [props.dictData];
|
||||||
@ -44,8 +41,7 @@ const dictTagData = computed<Api.System.DictData[]>(() => {
|
|||||||
:key="item.dictValue"
|
:key="item.dictValue"
|
||||||
class="m-1"
|
class="m-1"
|
||||||
:class="[item.cssClass]"
|
:class="[item.cssClass]"
|
||||||
:type="item.listClass"
|
:type="item.listClass || 'default'"
|
||||||
v-bind="attrs"
|
|
||||||
>
|
>
|
||||||
{{ item.dictLabel }}
|
{{ item.dictLabel }}
|
||||||
</NTag>
|
</NTag>
|
||||||
|
Reference in New Issue
Block a user