Hola, me gustaría poner una condición en el nombre de la opción si el objeto sku.attributes está vacío, el nombre es el mismo producto, de lo contrario, muestra el color y el tamaño.
skusListProduct = [{attributes:{size:'m', color: 'black'}}] // ex array <select v-model="skuList" @change="productChoice" > <option v-for="sku in skusListProduct" :key="sku.id" :value="sku.id" > <span v-if="sku.attributes && sku.attributes.length > 0"> {{ sku.attributes.color }} {{ sku.attributes.size }} </span> <span v-else> same product </span> </option> </select>Estoy haciendo eso pero no funciona
Resolví mi respuesta, verifique si las claves sku.attributes existen
sku.attributes && Object.keys(sku.attributes).length > 0