File tree Expand file tree Collapse file tree 4 files changed +17
-12
lines changed
image-viewer/__test__/__snapshots__ Expand file tree Collapse file tree 4 files changed +17
-12
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ exports[`image-viewer :base 1`] = `
50
50
<wx-image
51
51
ariaHidden = " {{true}}"
52
52
ariaLabel = " "
53
- class = " class t-class t-image t-image--shape-square"
54
- hidden = " {{true}}"
53
+ class = " class t-class t-image t-image--shape-square t-image--lazy"
55
54
id = " image"
56
55
lazyLoad = " {{true}}"
57
56
mode = " aspectFit"
@@ -115,8 +114,7 @@ exports[`image-viewer :base 2`] = `
115
114
<wx-image
116
115
ariaHidden = " {{true}}"
117
116
ariaLabel = " "
118
- class = " class t-class t-image t-image--shape-square"
119
- hidden = " {{true}}"
117
+ class = " class t-class t-image t-image--shape-square t-image--lazy"
120
118
id = " image"
121
119
lazyLoad = " {{true}}"
122
120
mode = " aspectFit"
@@ -180,8 +178,7 @@ exports[`image-viewer :base 3`] = `
180
178
<wx-image
181
179
ariaHidden = " {{true}}"
182
180
ariaLabel = " "
183
- class = " class t-class t-image t-image--shape-square"
184
- hidden = " {{true}}"
181
+ class = " class t-class t-image t-image--shape-square t-image--lazy"
185
182
id = " image"
186
183
lazyLoad = " {{true}}"
187
184
mode = " aspectFit"
Original file line number Diff line number Diff line change @@ -46,8 +46,7 @@ exports[`image :base 1`] = `
46
46
<wx-image
47
47
ariaHidden = " {{true}}"
48
48
ariaLabel = " "
49
- class = " class t-class t-image t-image--shape-square"
50
- hidden = " {{true}}"
49
+ class = " class t-class t-image t-image--shape-square t-image--lazy"
51
50
id = " image"
52
51
lazyLoad = " {{false}}"
53
52
mode = " scaleToFill"
@@ -71,8 +70,7 @@ exports[`image :success 1`] = `
71
70
<wx-image
72
71
ariaHidden = " {{false}}"
73
72
ariaLabel = " "
74
- class = " class t-class t-image t-image--shape-square"
75
- hidden = " {{false}}"
73
+ class = " class t-class t-image t-image--shape-square "
76
74
id = " image"
77
75
lazyLoad = " {{false}}"
78
76
mode = " heightFix"
Original file line number Diff line number Diff line change 5
5
@image-loading-color : var (--td-image-loading-color , @text-color-placeholder);
6
6
@image-round-radius : var (--td-image-round-radius , @radius-default);
7
7
8
+ :host {
9
+ position : relative ;
10
+ }
11
+
8
12
.@{prefix} -image {
9
13
color : @image-color ;
10
14
vertical-align : top ;
27
31
height : 100% ;
28
32
}
29
33
34
+ &--lazy {
35
+ position : absolute ;
36
+ top : 0 ;
37
+ z-index : -1 ;
38
+ }
39
+
30
40
&--shape {
31
41
&-circle {
32
42
border-radius : 50% ;
Original file line number Diff line number Diff line change 37
37
<!-- 图片 -->
38
38
<image
39
39
id="{{tId||'image'}}"
40
- hidden ="{{isLoading || isFailed}}"
41
- class="class {{prefix}}-class {{classPrefix}} {{classPrefix}}--shape-{{shape}}"
40
+ wx:if ="{{ ! isFailed }}"
41
+ class="class {{prefix}}-class {{classPrefix}} {{classPrefix}}--shape-{{shape}} {{isLoading ? classPrefix + '--lazy' : ''}} "
42
42
src="{{src}}"
43
43
style="{{_._style([innerStyle, style, customStyle])}}"
44
44
mode="{{mode}}"
You can’t perform that action at this time.
0 commit comments