mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
chore: 修改代码,列表头部插槽方式添加按钮
This commit is contained in:
@ -10,7 +10,7 @@ interface Props {
|
||||
value?: string[] | number[] | string | number;
|
||||
dictCode?: string;
|
||||
immediate?: boolean;
|
||||
dictData?: Api.System.DictData[];
|
||||
dictData?: Api.System.DictData;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ const attrs = useAttrs() as TagProps;
|
||||
|
||||
const dictTagData = computed<Api.System.DictData[]>(() => {
|
||||
if (props.dictData) {
|
||||
return props.dictData;
|
||||
return [props.dictData];
|
||||
}
|
||||
// 避免 props.value 为 0 时,无法触发
|
||||
if (props.dictCode && isNotNull(props.value)) {
|
||||
@ -42,7 +42,7 @@ const dictTagData = computed<Api.System.DictData[]>(() => {
|
||||
<NTag
|
||||
v-for="item in dictTagData"
|
||||
:key="item.dictValue"
|
||||
class="mb-2 mr-2"
|
||||
class="m-1"
|
||||
:class="[item.cssClass]"
|
||||
:type="item.listClass"
|
||||
v-bind="attrs"
|
||||
|
Reference in New Issue
Block a user