You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
710 B
36 lines
710 B
9 months ago
|
<template>
|
||
|
<detail-cell v-if="skus.length > 0" label="选择" :value="value"></detail-cell>
|
||
|
</template>
|
||
|
|
||
|
<script setup>
|
||
|
import { computed } from 'vue';
|
||
|
|
||
|
import detailCell from './detail-cell.vue';
|
||
|
|
||
|
const props = defineProps({
|
||
|
modelValue: {
|
||
|
type: Array,
|
||
|
default() {
|
||
|
return [];
|
||
|
},
|
||
|
},
|
||
|
skus: {
|
||
|
type: Array,
|
||
|
default() {
|
||
|
return [];
|
||
|
},
|
||
|
},
|
||
|
});
|
||
|
const value = computed(() => {
|
||
|
let str = '';
|
||
|
if (props.modelValue.length > 0) {
|
||
|
props.modelValue.forEach((item, index) => {
|
||
|
str += props.skus[index].name + ':' + item + ' ';
|
||
|
});
|
||
|
} else {
|
||
|
str = '请选择商品规格';
|
||
|
}
|
||
|
return str;
|
||
|
});
|
||
|
</script>
|