fix: 修正产品规格值product_spec的显示问题
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m8s
All checks were successful
deploy to server / build-and-deploy (push) Successful in 3m8s
- subItem.value => subItem.key - 调整后端CMS的结构,将规格值移入translations中
This commit is contained in:
@ -11,7 +11,7 @@
|
||||
<el-descriptions-item
|
||||
v-for="subItem in item.specs"
|
||||
:key="subItem.key"
|
||||
:label="subItem.value"
|
||||
:label="subItem.key"
|
||||
>
|
||||
{{ subItem.value }}
|
||||
</el-descriptions-item>
|
||||
|
||||
@ -34,9 +34,8 @@ export const useProduct = (id: string) => {
|
||||
specs: [
|
||||
'id',
|
||||
{
|
||||
translations: ['id', 'key'],
|
||||
translations: ['id', 'key', 'value'],
|
||||
},
|
||||
'value',
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
@ -61,12 +61,13 @@ export function toProductSpecGroupView(
|
||||
export function toProductSpecView(raw: ProductSpec): ProductSpecView {
|
||||
const trans = raw.translations?.[0] ?? {
|
||||
key: '',
|
||||
value: '',
|
||||
};
|
||||
|
||||
return {
|
||||
id: raw.id,
|
||||
key: trans.key,
|
||||
value: raw.value,
|
||||
value: trans.value,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user