feat:【antd】【mall】ProductAttributes 组件样式优化

This commit is contained in:
puhui999
2025-11-24 14:23:36 +08:00
parent 0ae62ef7e7
commit c842592d10

View File

@@ -82,10 +82,10 @@ watch(
/** 删除属性值 */ /** 删除属性值 */
function handleCloseValue(index: number, value: PropertyAndValues) { function handleCloseValue(index: number, value: PropertyAndValues) {
if (attributeList.value[index]) { if (attributeList.value[index]?.values) {
attributeList.value[index].values = attributeList.value?.[ attributeList.value[index].values = attributeList.value[
index index
]?.values?.filter((item) => item.id !== value.id); ].values?.filter((item) => item.id !== value.id);
} }
} }
@@ -166,9 +166,8 @@ async function getAttributeOptions(propertyId: number) {
<template> <template>
<Col v-for="(attribute, index) in attributeList" :key="index"> <Col v-for="(attribute, index) in attributeList" :key="index">
<Divider class="my-4" /> <Divider class="my-3" />
<!-- TODO @puhui9991间隙可以看看2)vue3 + element-plus 添加属性这个按钮是和属性名在一排感觉更好看点 --> <div class="mt-2 flex flex-wrap items-center gap-2">
<div class="mt-1">
<span class="mx-1">属性名</span> <span class="mx-1">属性名</span>
<Tag <Tag
:closable="!isDetail" :closable="!isDetail"
@@ -179,7 +178,7 @@ async function getAttributeOptions(propertyId: number) {
{{ attribute.name }} {{ attribute.name }}
</Tag> </Tag>
</div> </div>
<div class="mt-2"> <div class="mt-2 flex flex-wrap items-center gap-2">
<span class="mx-1">属性值</span> <span class="mx-1">属性值</span>
<Tag <Tag
v-for="(value, valueIndex) in attribute.values" v-for="(value, valueIndex) in attribute.values"
@@ -188,8 +187,7 @@ async function getAttributeOptions(propertyId: number) {
class="mx-1" class="mx-1"
@close="handleCloseValue(index, value)" @close="handleCloseValue(index, value)"
> >
<!-- TODO @puhui999这里貌似爆红idea --> {{ value?.name }}
{{ value.name }}
</Tag> </Tag>
<Select <Select
v-show="inputVisible(index)" v-show="inputVisible(index)"