refactor: 添加属性
This commit is contained in:
parent
94a578a087
commit
91b19f3a4f
@ -1,5 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed } from 'vue';
|
||||
import { computed, useAttrs } from 'vue';
|
||||
import type { TagProps } from 'naive-ui';
|
||||
import { useDict } from '@/hooks/business/dict';
|
||||
import { isNotNull } from '@/utils/common';
|
||||
|
||||
@ -20,6 +21,8 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
value: () => []
|
||||
});
|
||||
|
||||
const attrs = useAttrs() as TagProps;
|
||||
|
||||
const dictTagData = computed<Api.System.DictData[]>(() => {
|
||||
if (props.dictData) {
|
||||
return [props.dictData];
|
||||
@ -41,6 +44,7 @@ const dictTagData = computed<Api.System.DictData[]>(() => {
|
||||
:key="item.dictValue"
|
||||
class="m-1"
|
||||
:class="[item.cssClass]"
|
||||
v-bind="attrs"
|
||||
:type="item.listClass || 'default'"
|
||||
>
|
||||
{{ item.dictLabel }}
|
||||
|
Loading…
Reference in New Issue
Block a user