bugfix: 切换性别清空选中的商品类别
This commit is contained in:
@@ -44,7 +44,7 @@
|
|||||||
@update:product-name="currentListing.productName = $event"
|
@update:product-name="currentListing.productName = $event"
|
||||||
@update:price="currentListing.price = $event"
|
@update:price="currentListing.price = $event"
|
||||||
@update:desc="currentListing.desc = $event"
|
@update:desc="currentListing.desc = $event"
|
||||||
@update:gender="currentListing.gender = $event"
|
@update:gender="handleUpdateGender"
|
||||||
@update:category="currentListing.category = $event"
|
@update:category="currentListing.category = $event"
|
||||||
/>
|
/>
|
||||||
<div class="page-control flex align-center" v-if="selectList.length > 1">
|
<div class="page-control flex align-center" v-if="selectList.length > 1">
|
||||||
@@ -150,6 +150,13 @@
|
|||||||
|
|
||||||
const currentListing = computed(() => selectList.value[currentIndex.value])
|
const currentListing = computed(() => selectList.value[currentIndex.value])
|
||||||
|
|
||||||
|
const handleUpdateGender = (gender: string) => {
|
||||||
|
if (currentListing.value.gender === gender) return
|
||||||
|
|
||||||
|
currentListing.value.gender = gender
|
||||||
|
currentListing.value.category = null
|
||||||
|
}
|
||||||
|
|
||||||
const previewImageMap = computed(() => ({
|
const previewImageMap = computed(() => ({
|
||||||
sketch: currentListing.value.sketch,
|
sketch: currentListing.value.sketch,
|
||||||
mainProductImage: currentListing.value.mainProductImage,
|
mainProductImage: currentListing.value.mainProductImage,
|
||||||
|
|||||||
Reference in New Issue
Block a user