gyyg-components 0.2.22 → 0.2.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gyyg-components",
3
- "version": "0.2.22",
3
+ "version": "0.2.24",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <div>
3
- <el-descriptions :column="column" :title="title" :extra="extra" :direction="direction" :border="border">
3
+ <el-descriptions
4
+ :column="column"
5
+ :title="title"
6
+ :extra="extra"
7
+ :direction="direction"
8
+ :border="border"
9
+ :class="!title ? 'no-title' : ''"
10
+ >
4
11
  <template #title>
5
12
  <div class="title">{{ title }}</div>
6
13
  <div class="top-content">
@@ -9,21 +16,43 @@
9
16
  </div>
10
17
  </template>
11
18
 
12
- <el-descriptions-item v-for="(item, index) in detailsData" :key="index" :label="item.label" :span="item.span || 1">
19
+ <el-descriptions-item
20
+ v-for="(item, index) in detailsData"
21
+ :key="index"
22
+ :label="item.label"
23
+ :span="item.span || 1"
24
+ >
13
25
  <div v-if="item.type === 'img'">
14
- <el-image
26
+ <el-image
15
27
  v-for="(url, index) in item.value"
16
28
  :key="index"
17
29
  style="width: 100px; height: 100px; margin-right: 10px;"
18
- :src="url"
19
- :preview-src-list="item.value">
30
+ :src="url"
31
+ :preview-src-list="item.value"
32
+ >
20
33
  </el-image>
21
34
  </div>
22
35
  <div v-else-if="item.type === 'voice'">
23
- <audio controls="controls" style="width: 240px; height: 40px;" v-for="item in item.value" :key="item.id">
24
- <source :src="item" type="audio/mp3">
36
+ <audio
37
+ controls="controls"
38
+ style="width: 240px; height: 40px;"
39
+ v-for="item in item.value"
40
+ :key="item.id"
41
+ >
42
+ <source
43
+ :src="item"
44
+ type="audio/mp3"
45
+ >
25
46
  </audio>
26
47
  </div>
48
+ <div v-else-if="item.type === 'custom'">
49
+ <component
50
+ :is="item.componentName"
51
+ v-model="item.value"
52
+ v-bind="typeof item.componentProps === 'function' ? item.componentProps(item) : item.componentProps"
53
+ v-on="typeof item.componentListeners === 'function' ? item.componentListeners(item) : item.componentListeners || {}"
54
+ />
55
+ </div>
27
56
  <span v-else>{{ item.value }}</span>
28
57
  </el-descriptions-item>
29
58
  </el-descriptions>
@@ -75,6 +104,13 @@ export default {
75
104
  /deep/ .el-descriptions__header {
76
105
  display: block;
77
106
  }
107
+
108
+ .no-title {
109
+ /deep/ .el-descriptions__header {
110
+ display: none;
111
+ }
112
+ }
113
+
78
114
  .title {
79
115
  padding-left: 10px;
80
116
  height: 30px;
@@ -85,14 +121,17 @@ export default {
85
121
  color: #606266;
86
122
  font-size: 14px;
87
123
  }
124
+
88
125
  .top-content {
89
126
  color: #606266;
90
127
  font-size: 14px;
91
128
  font-weight: normal;
92
129
  }
130
+
93
131
  /deep/ .el-descriptions-item__label {
94
132
  white-space: nowrap;
95
133
  }
134
+
96
135
  /deep/ .el-descriptions__body .el-descriptions__table .el-descriptions-item__cell {
97
136
  white-space: pre-wrap;
98
137
  }
@@ -9,7 +9,6 @@
9
9
  <el-badge
10
10
  :is-dot="btn.isDot"
11
11
  :value="btn.number"
12
- :style="btn.number ? 'margin-right: 20px;' : ''"
13
12
  >
14
13
  <el-button
15
14
  v-if="!btn['componentType']"
@@ -96,4 +95,8 @@ export default {
96
95
  }
97
96
  }
98
97
  }
98
+ /deep/ .el-badge__content.is-fixed {
99
+ top: -2px;
100
+ right: 23px;
101
+ }
99
102
  </style>