mall-uniapp/pages/goods/components/detail/detail-cell-sku.vue

32 lines
641 B
Vue
Raw Normal View History

2022-11-22 07:45:36 +00:00
<template>
2023-12-10 03:57:24 +00:00
<!-- SKU 选择的提示框 -->
<detail-cell label="选择" :value="value" />
2022-11-22 07:45:36 +00:00
</template>
<script setup>
import { computed } from 'vue';
import detailCell from './detail-cell.vue';
const props = defineProps({
modelValue: {
type: Array,
default() {
return [];
},
},
2023-12-10 03:57:24 +00:00
sku: {
type: Object
}
2022-11-22 07:45:36 +00:00
});
const value = computed(() => {
2024-01-10 14:57:06 +00:00
if (!props.sku?.id) {
2023-12-10 03:57:24 +00:00
return '请选择商品规格';
2022-11-22 07:45:36 +00:00
}
2023-12-10 03:57:24 +00:00
let str = '';
props.sku.properties.forEach(property => {
str += property.propertyName + ':' + property.valueName + ' ';
});
2022-11-22 07:45:36 +00:00
return str;
});
</script>