1234567891011121314151617181920212223242526272829303132333435363738 |
- <template>
- <!-- SKU 选择的提示框 -->
- <detail-cell :label="$t('common.select')" :value="value" />
- </template>
- <script setup>
- import {
- computed
- } from 'vue';
- import detailCell from './detail-cell.vue';
- import { t } from '@/locale'
- const props = defineProps({
- modelValue: {
- type: Array,
- default () {
- return [];
- },
- },
- sku: {
- type: Object
- }
- });
- const value = computed(() => {
- if (!props.sku?.id) {
- return t('common.select_product_specification');
- }
- let str = '';
- props.sku.properties.forEach(property => {
- if (property.valueName === property.propertyName) {
- str += property.propertyName;
- } else {
- str += property.propertyName + ':' + property.valueName + ' ';
- }
- });
- return str;
- });
- </script>
|