refactor: eslint src --fix

This commit is contained in:
2024-04-15 20:35:37 +08:00
parent c75c7092bd
commit 7ecfbb9c15
38 changed files with 187 additions and 227 deletions

View File

@@ -1,21 +1,11 @@
<template>
<span v-if="!dictItem"></span>
<span v-else-if="!dictItem.color">{{ dictItem.label }}</span>
<a-tag v-else-if="dictItem.color === 'primary'" color="arcoblue">{{
dictItem.label
}}</a-tag>
<a-tag v-else-if="dictItem.color === 'success'" color="green">{{
dictItem.label
}}</a-tag>
<a-tag v-else-if="dictItem.color === 'warning'" color="orangered">{{
dictItem.label
}}</a-tag>
<a-tag v-else-if="dictItem.color === 'error'" color="red">{{
dictItem.label
}}</a-tag>
<a-tag v-else-if="dictItem.color === 'default'" color="gray">{{
dictItem.label
}}</a-tag>
<a-tag v-else-if="dictItem.color === 'primary'" color="arcoblue">{{ dictItem.label }}</a-tag>
<a-tag v-else-if="dictItem.color === 'success'" color="green">{{ dictItem.label }}</a-tag>
<a-tag v-else-if="dictItem.color === 'warning'" color="orangered">{{ dictItem.label }}</a-tag>
<a-tag v-else-if="dictItem.color === 'error'" color="red">{{ dictItem.label }}</a-tag>
<a-tag v-else-if="dictItem.color === 'default'" color="gray">{{ dictItem.label }}</a-tag>
<a-tag v-else :color="dictItem.color">{{ dictItem.label }}</a-tag>
</template>
@@ -27,19 +17,17 @@ defineOptions({ name: 'GiCellTag' })
const props = defineProps({
dict: {
type: Array<LabelValueState>,
required: true,
required: true
},
value: {
type: [Number, String],
required: true,
},
});
required: true
}
})
const dictItem = computed(() =>
props.dict.find(
(d) => d.value === String(props.value) || d.value === Number(props.value),
),
);
props.dict.find((d) => d.value === String(props.value) || d.value === Number(props.value))
)
</script>
<style lang="scss" scoped></style>