|
@@ -93,13 +93,10 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div class="specs-body">
|
|
<div class="specs-body">
|
|
|
<div class="body-item" v-for="(its,ind) in item.list" :key="ind">
|
|
<div class="body-item" v-for="(its,ind) in item.list" :key="ind">
|
|
|
|
|
+ <div class="item-img"><sc-upload v-model="its.img"></sc-upload></div>
|
|
|
<el-input placeholder="输入规格属性名" v-model="its.name" clearable>
|
|
<el-input placeholder="输入规格属性名" v-model="its.name" clearable>
|
|
|
<template #append>
|
|
<template #append>
|
|
|
- <el-popconfirm title="确定删除吗?" @click="removeItem(indx,ind)">
|
|
|
|
|
- <template #reference>
|
|
|
|
|
- <el-button type="danger" icon="el-icon-delete" size="small"></el-button>
|
|
|
|
|
- </template>
|
|
|
|
|
- </el-popconfirm>
|
|
|
|
|
|
|
+ <el-button type="danger" @click="removeItem(indx,ind)" icon="el-icon-delete" size="small"></el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-input>
|
|
</el-input>
|
|
|
</div>
|
|
</div>
|
|
@@ -159,13 +156,13 @@ export default {
|
|
|
if (this.specs.length >= 5) {
|
|
if (this.specs.length >= 5) {
|
|
|
return this.$message.error("最多只能添加三组规格")
|
|
return this.$message.error("最多只能添加三组规格")
|
|
|
}
|
|
}
|
|
|
- this.specs.push({"name":"","num":1,"list":[ {"name":"","check":true} ]});
|
|
|
|
|
|
|
+ this.specs.push({"name":"","num":1,"list":[ {"name":"","img":"","check":true} ]});
|
|
|
},
|
|
},
|
|
|
addItem(index){
|
|
addItem(index){
|
|
|
if (this.specs[index].list.length >= 20) {
|
|
if (this.specs[index].list.length >= 20) {
|
|
|
return this.$message.error("最多只能添加20个")
|
|
return this.$message.error("最多只能添加20个")
|
|
|
}
|
|
}
|
|
|
- this.specs[index].list.push({"name":"","check":true})
|
|
|
|
|
|
|
+ this.specs[index].list.push({"name":"","img":"","check":true})
|
|
|
},
|
|
},
|
|
|
removeSpec(index){
|
|
removeSpec(index){
|
|
|
this.specs.splice(index,1)
|
|
this.specs.splice(index,1)
|
|
@@ -240,5 +237,6 @@ export default {
|
|
|
margin-right: 0;
|
|
margin-right: 0;
|
|
|
}
|
|
}
|
|
|
.specs-body{display: flex;align-items: center;gap: 10px;padding: 10px;flex-direction: row;flex-wrap: wrap;}
|
|
.specs-body{display: flex;align-items: center;gap: 10px;padding: 10px;flex-direction: row;flex-wrap: wrap;}
|
|
|
-.specs-body .body-item{width: calc(25% - 10px);}
|
|
|
|
|
|
|
+.specs-body .body-item{width: calc(25% - 10px);border: 1px solid #ddd;padding: 5px;display: flex;align-items: center;justify-content: center;flex-direction: column;}
|
|
|
|
|
+.item-img{margin-bottom: 5px;}
|
|
|
</style>
|
|
</style>
|