@tplc/wot 0.1.46 → 0.1.47
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/CHANGELOG.md +2 -0
- package/components/wd-img/wd-img.vue +14 -11
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.1.47](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.37...v0.1.47) (2024-12-26)
|
|
6
|
+
|
|
5
7
|
### [0.1.46](http://gitlab888.30jia.com.cn/bhBank/zero-code-pro/compare/v0.2.36...v0.1.46) (2024-12-26)
|
|
6
8
|
|
|
7
9
|
|
|
@@ -1,17 +1,22 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<view :class="rootClass" @click="handleClick" :style="rootStyle">
|
|
3
|
+
<image
|
|
4
|
+
v-if="status !== 'success'"
|
|
5
|
+
:class="`wd-img__image coverImg ${customImage}`"
|
|
6
|
+
:src="wrapPhoto({ photo: src, width: lazyPlaceWidth })"
|
|
7
|
+
:mode="mode"
|
|
8
|
+
:lazy-load="lazyLoad"
|
|
9
|
+
/>
|
|
3
10
|
<image
|
|
4
11
|
:class="`wd-img__image coverImg ${customImage}`"
|
|
5
12
|
:src="wrapPhoto({ photo: src, width, type: 2 })"
|
|
6
13
|
:mode="mode"
|
|
7
|
-
:style="
|
|
8
|
-
status != 'success' && {
|
|
9
|
-
...wrapPhoto({ photo: src, width: lazyPlaceWidth }),
|
|
10
|
-
}
|
|
11
|
-
"
|
|
12
14
|
:lazy-load="lazyLoad"
|
|
13
15
|
@load="handleLoad"
|
|
14
16
|
@error="handleError"
|
|
17
|
+
:style="{
|
|
18
|
+
display: status === 'success' ? 'block' : 'none',
|
|
19
|
+
}"
|
|
15
20
|
/>
|
|
16
21
|
<slot v-if="status === 'loading'" name="loading"></slot>
|
|
17
22
|
<slot v-if="status === 'error'" name="error"></slot>
|
|
@@ -75,18 +80,14 @@ function handleLoad(event: Event) {
|
|
|
75
80
|
emit('load', event)
|
|
76
81
|
}
|
|
77
82
|
|
|
78
|
-
function wrapPhoto({ photo, width = 200,
|
|
83
|
+
function wrapPhoto({ photo, width = 200, type = 1 }: any) {
|
|
79
84
|
const isctyun = photo?.indexOf('.ctyun') >= 0
|
|
80
85
|
const sym = photo?.indexOf('?') > 0 ? '&' : '?'
|
|
81
86
|
const suffix = isctyun
|
|
82
87
|
? `${sym}x-amz-process=image/resize,w_${width},m_lfit`
|
|
83
88
|
: `${sym}x-oss-process=image/resize,m_mfit,w_${width}&imageView2/2/w/${width}`
|
|
84
89
|
const url = `${photo}${width > 0 ? suffix : ''}`
|
|
85
|
-
return
|
|
86
|
-
? url
|
|
87
|
-
: photo
|
|
88
|
-
? { backgroundImage: `url('${url}')`, ...otherParams }
|
|
89
|
-
: otherParams
|
|
90
|
+
return url
|
|
90
91
|
}
|
|
91
92
|
</script>
|
|
92
93
|
|
|
@@ -96,5 +97,7 @@ function wrapPhoto({ photo, width = 200, otherParams = {}, type = 1 }: any) {
|
|
|
96
97
|
.coverImg {
|
|
97
98
|
background-repeat: no-repeat;
|
|
98
99
|
background-size: cover;
|
|
100
|
+
width: 100%;
|
|
101
|
+
height: 100%;
|
|
99
102
|
}
|
|
100
103
|
</style>
|