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