@xilonglab/vue-main 1.3.10 → 1.3.11

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": "@xilonglab/vue-main",
3
- "version": "1.3.10",
3
+ "version": "1.3.11",
4
4
  "description": "xilong vue main",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -0,0 +1,59 @@
1
+ <script setup>
2
+ defineOptions({ name: "XlBoxImage" })
3
+
4
+ import { computed } from 'vue'
5
+
6
+ const props = defineProps({
7
+ value: {
8
+ type: Object,
9
+ default: () => ({})
10
+ },
11
+ boxwidth: {
12
+ type: Number,
13
+ default: 100
14
+ },
15
+ boxheight: {
16
+ type: Number,
17
+ default: 100
18
+ },
19
+ })
20
+
21
+ const imageSrc = computed(() => {
22
+ if (props.value && props.value.uri) {
23
+ return `/storage/${props.value.uri}`
24
+ }
25
+ return ''
26
+ })
27
+
28
+ </script>
29
+
30
+ <template>
31
+ <div class="xl-box-image"
32
+ :style="{
33
+ width: `${boxwidth}px`,
34
+ height: `${boxheight}px`
35
+ }">
36
+ <img v-if="imageSrc"
37
+ class="image"
38
+ :src="imageSrc" />
39
+ </div>
40
+ </template>
41
+
42
+ <style lang="less" scoped>
43
+ .xl-box-image {
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ overflow: hidden;
48
+ border: 1px solid var(--el-border-color);
49
+ border-radius: 4px;
50
+
51
+ .image {
52
+ max-width: 100%;
53
+ max-height: 100%;
54
+ display: block;
55
+ object-fit: contain;
56
+ }
57
+ }
58
+ </style>
59
+
@@ -131,7 +131,7 @@ const { refs, api, params, obj, chartOptions, total } = inject('injections')
131
131
  :p="col.prop"
132
132
  />
133
133
  <xl-map-col
134
- v-else-if="col.type === 'map'"
134
+ v-else-if="col.map"
135
135
  :l="col.label"
136
136
  :p="col.prop"
137
137
  :width="col.width"
@@ -29,7 +29,7 @@ const props = defineProps({
29
29
  :p="col.prop"
30
30
  />
31
31
  <xl-map-col
32
- v-else-if="col.type === 'map'"
32
+ v-else-if="col.map"
33
33
  :l="col.label"
34
34
  :p="col.prop"
35
35
  :width="col.width"