forked from Project-HAMi/HAMi-WebUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInfoPreview.vue
More file actions
49 lines (46 loc) · 1011 Bytes
/
Copy pathInfoPreview.vue
File metadata and controls
49 lines (46 loc) · 1011 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<template>
<div class="info-preview">
<el-descriptions :title="title" :column="column" style="padding: 20px">
<el-descriptions-item
:label="label"
:key="value"
v-for="{ label, value, render } in columns"
>
<span v-if="render">
<component
v-if="isVNode(render(data))"
:is="render(data)"
></component>
<span v-else>{{ render(data) }}</span>
</span>
<span v-else>
{{ data[value] }}
</span>
</el-descriptions-item>
</el-descriptions>
<button-group :items="actions" :record="data" />
</div>
</template>
<script setup lang="jsx">
import { isVNode } from 'vue';
defineProps({
data: Object,
column: {
type: Number,
default() {
return 2;
},
},
columns: Array,
title: String,
actions: Array,
});
</script>
<style lang="scss">
.info-preview {
.el-descriptions__label {
min-width: 150px;
display: inline-block;
}
}
</style>