mirror of
https://github.com/youzan/vant.git
synced 2025-11-28 01:06:29 +08:00
@@ -183,9 +183,9 @@ export default createComponent({
|
||||
}
|
||||
|
||||
// 属性未全选
|
||||
return !this.propList.some(
|
||||
(it) => (this.selectedProp[it.k_id] || []).length < 1
|
||||
);
|
||||
return !this.propList
|
||||
.filter((i) => i.is_necessary !== false)
|
||||
.some((i) => (this.selectedProp[i.k_id] || []).length === 0);
|
||||
},
|
||||
|
||||
isSkuEmpty() {
|
||||
|
||||
@@ -179,6 +179,24 @@ export function getSkuData(largeImageMode = false) {
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
k: '非必选属性',
|
||||
k_id: 125,
|
||||
is_multiple: true,
|
||||
is_necessary: false,
|
||||
v: [
|
||||
{
|
||||
id: 1234,
|
||||
name: '属性1',
|
||||
price: 3,
|
||||
},
|
||||
{
|
||||
id: 1235,
|
||||
name: '属性2',
|
||||
price: 4,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
1
types/sku.d.ts
vendored
1
types/sku.d.ts
vendored
@@ -32,6 +32,7 @@ export type SkuPropItemData = {
|
||||
v: SkuPropItemValueData[];
|
||||
k_id: number;
|
||||
is_multiple?: boolean;
|
||||
is_necessary?: boolean;
|
||||
};
|
||||
|
||||
export type SkuPropItemValueData = {
|
||||
|
||||
Reference in New Issue
Block a user