feat: 完成网站前端的基本建设
- 网站内容展示:首页, 产品页, 解决方案, 联系信息等 - 网站跳转逻辑:通过Vue-Router实现路由跳转 - 后端通信: 通过Nuxt Strapi与后端Strapi服务进行通信
This commit is contained in:
34
app/components/SpecTable.vue
Normal file
34
app/components/SpecTable.vue
Normal file
@ -0,0 +1,34 @@
|
||||
<template>
|
||||
<div class="spec-collapse">
|
||||
<el-collapse v-model="activeName">
|
||||
<el-collapse-item v-for="item in data" :key="item.title" :title="item.title" :name="item.title">
|
||||
<el-descriptions :column="1" border>
|
||||
<el-descriptions-item v-for="subItem in item.items" :key="subItem.label" :label="subItem.label">
|
||||
{{ subItem.value }}
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-collapse-item>
|
||||
</el-collapse>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
const props = defineProps({
|
||||
data: {
|
||||
type: Object as () => ProductionSpecGroup[],
|
||||
required: true
|
||||
}
|
||||
})
|
||||
|
||||
// 默认全部展开
|
||||
const activeName = ref<string[]>(props.data.map((item: ProductionSpecGroup) => {
|
||||
return item.title
|
||||
}) || [])
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.spec-collapse ::v-deep(.el-collapse-item__header) {
|
||||
font-size: 1rem;
|
||||
padding: 1rem;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user