提交 3e7c3e82 authored 作者: 王鹏飞's avatar 王鹏飞

chore: update

上级 e262f8c8
......@@ -18,13 +18,13 @@ async function fetchInfo() {
onMounted(fetchInfo)
const attributes = computed<ConfigAttribute[]>(() => {
const config_attributes = detail.value.config_attributes || []
if (typeof config_attributes === 'string') {
return JSON.parse(config_attributes)
} else {
return config_attributes || []
let attrs = detail.value.config_attributes || []
if (typeof attrs === 'string') {
attrs = JSON.parse(attrs)
}
return Array.isArray(attrs) ? attrs : []
})
function getAttributeValueByProp(prop: string) {
return attributes.value.find(item => item.prop === prop)?.value || ''
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论