refactor(device-common-card): optimize UI with NDescriptions
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { NCard } from 'naive-ui';
|
import { NCard, NDescriptions, NDescriptionsItem } from 'naive-ui';
|
||||||
import { computed, toRefs } from 'vue';
|
import { computed, toRefs } from 'vue';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
@@ -16,10 +16,11 @@ const commonInfoEntries = computed(() => Object.entries(commonInfo.value ?? {}))
|
|||||||
<template #header>
|
<template #header>
|
||||||
<div>设备信息</div>
|
<div>设备信息</div>
|
||||||
</template>
|
</template>
|
||||||
<div v-for="item in commonInfoEntries" :key="item[0]">
|
<NDescriptions bordered label-placement="left">
|
||||||
<span>{{ item[0] }}:</span>
|
<template v-for="item in commonInfoEntries" :key="item[0]">
|
||||||
<span>{{ item[1] }}</span>
|
<NDescriptionsItem :label="item[0]">{{ item[1] }}</NDescriptionsItem>
|
||||||
</div>
|
</template>
|
||||||
|
</NDescriptions>
|
||||||
</NCard>
|
</NCard>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user