Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(image): loading时图片加载错位 #3128

Merged
merged 3 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
267 changes: 141 additions & 126 deletions src/image-viewer/__test__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,59 +8,64 @@ exports[`image-viewer :base 1`] = `
bind:load="onImageLoadSuccess"
>
<wx-view
ariaHidden="{{false}}"
class="class t-class t-image t-image__mask t-image--loading t-image--shape-square"
class="class t-class t-image"
style=""
>
<t-loading
tClass="t-class-load"
tClassText="t-image--loading-text"
<wx-view
ariaHidden="{{false}}"
class="t-image__mask t-image--loading t-image--shape-square"
style=""
>
<wx-view
class="class t-class t-loading t-loading--horizontal"
style="width: 44rpx; height: 44rpx; color: inherit;"
<t-loading
tClass="t-class-load"
tClassText="t-image--loading-text"
>
<wx-view
ariaLabel="加载中"
ariaRole="img"
class="t-class-indicator t-loading__spinner t-loading__spinner--dots "
style="width: 44rpx; height: 44rpx; color: inherit; animation-duration: 0.8s; animation-play-state: running;"
class="class t-class t-loading t-loading--horizontal"
style="width: 44rpx; height: 44rpx; color: inherit;"
>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.26666666666666666s; animation-play-state: running;"
/>
ariaLabel="加载中"
ariaRole="img"
class="t-class-indicator t-loading__spinner t-loading__spinner--dots "
style="width: 44rpx; height: 44rpx; color: inherit; animation-duration: 0.8s; animation-play-state: running;"
>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.26666666666666666s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.5333333333333333s; animation-play-state: running;"
/>
</wx-view>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.5333333333333333s; animation-play-state: running;"
ariaHidden="{{true}}"
ariaLabel=""
class="t-loading__text t-loading__text--horizontal t-class-text"
/>
</wx-view>
<wx-view
ariaHidden="{{true}}"
ariaLabel=""
class="t-loading__text t-loading__text--horizontal t-class-text"
/>
</wx-view>
</t-loading>
</t-loading>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="t-image__img t-image--shape-square t-image--lazy t-class-image"
id="image"
lazyLoad="{{true}}"
mode="aspectFit"
showMenuByLongpress="{{false}}"
src="a.png"
style=""
webp="{{false}}"
bind:error="onLoadError"
bind:load="onLoaded"
/>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="class t-class t-image t-image--shape-square t-image--lazy"
id="image"
lazyLoad="{{true}}"
mode="aspectFit"
showMenuByLongpress="{{false}}"
src="a.png"
style=""
webp="{{false}}"
bind:error="onLoadError"
bind:load="onLoaded"
/>
</t-image>
`;

Expand All @@ -72,59 +77,64 @@ exports[`image-viewer :base 2`] = `
bind:load="onImageLoadSuccess"
>
<wx-view
ariaHidden="{{false}}"
class="class t-class t-image t-image__mask t-image--loading t-image--shape-square"
class="class t-class t-image"
style=""
>
<t-loading
tClass="t-class-load"
tClassText="t-image--loading-text"
<wx-view
ariaHidden="{{false}}"
class="t-image__mask t-image--loading t-image--shape-square"
style=""
>
<wx-view
class="class t-class t-loading t-loading--horizontal"
style="width: 44rpx; height: 44rpx; color: inherit;"
<t-loading
tClass="t-class-load"
tClassText="t-image--loading-text"
>
<wx-view
ariaLabel="加载中"
ariaRole="img"
class="t-class-indicator t-loading__spinner t-loading__spinner--dots "
style="width: 44rpx; height: 44rpx; color: inherit; animation-duration: 0.8s; animation-play-state: running;"
class="class t-class t-loading t-loading--horizontal"
style="width: 44rpx; height: 44rpx; color: inherit;"
>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.26666666666666666s; animation-play-state: running;"
/>
ariaLabel="加载中"
ariaRole="img"
class="t-class-indicator t-loading__spinner t-loading__spinner--dots "
style="width: 44rpx; height: 44rpx; color: inherit; animation-duration: 0.8s; animation-play-state: running;"
>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.26666666666666666s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.5333333333333333s; animation-play-state: running;"
/>
</wx-view>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.5333333333333333s; animation-play-state: running;"
ariaHidden="{{true}}"
ariaLabel=""
class="t-loading__text t-loading__text--horizontal t-class-text"
/>
</wx-view>
<wx-view
ariaHidden="{{true}}"
ariaLabel=""
class="t-loading__text t-loading__text--horizontal t-class-text"
/>
</wx-view>
</t-loading>
</t-loading>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="t-image__img t-image--shape-square t-image--lazy t-class-image"
id="image"
lazyLoad="{{true}}"
mode="aspectFit"
showMenuByLongpress="{{false}}"
src="a.png"
style=""
webp="{{false}}"
bind:error="onLoadError"
bind:load="onLoaded"
/>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="class t-class t-image t-image--shape-square t-image--lazy"
id="image"
lazyLoad="{{true}}"
mode="aspectFit"
showMenuByLongpress="{{false}}"
src="a.png"
style=""
webp="{{false}}"
bind:error="onLoadError"
bind:load="onLoaded"
/>
</t-image>
`;

Expand All @@ -136,58 +146,63 @@ exports[`image-viewer :base 3`] = `
bind:load="onImageLoadSuccess"
>
<wx-view
ariaHidden="{{false}}"
class="class t-class t-image t-image__mask t-image--loading t-image--shape-square"
class="class t-class t-image"
style=""
>
<t-loading
tClass="t-class-load"
tClassText="t-image--loading-text"
<wx-view
ariaHidden="{{false}}"
class="t-image__mask t-image--loading t-image--shape-square"
style=""
>
<wx-view
class="class t-class t-loading t-loading--horizontal"
style="width: 44rpx; height: 44rpx; color: inherit;"
<t-loading
tClass="t-class-load"
tClassText="t-image--loading-text"
>
<wx-view
ariaLabel="加载中"
ariaRole="img"
class="t-class-indicator t-loading__spinner t-loading__spinner--dots "
style="width: 44rpx; height: 44rpx; color: inherit; animation-duration: 0.8s; animation-play-state: running;"
class="class t-class t-loading t-loading--horizontal"
style="width: 44rpx; height: 44rpx; color: inherit;"
>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;"
/>
ariaLabel="加载中"
ariaRole="img"
class="t-class-indicator t-loading__spinner t-loading__spinner--dots "
style="width: 44rpx; height: 44rpx; color: inherit; animation-duration: 0.8s; animation-play-state: running;"
>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.26666666666666666s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.5333333333333333s; animation-play-state: running;"
/>
</wx-view>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.26666666666666666s; animation-play-state: running;"
/>
<wx-view
class="t-loading__dot"
style="animation-duration: 0.8s; animation-delay:0.5333333333333333s; animation-play-state: running;"
ariaHidden="{{true}}"
ariaLabel=""
class="t-loading__text t-loading__text--horizontal t-class-text"
/>
</wx-view>
<wx-view
ariaHidden="{{true}}"
ariaLabel=""
class="t-loading__text t-loading__text--horizontal t-class-text"
/>
</wx-view>
</t-loading>
</t-loading>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="t-image__img t-image--shape-square t-image--lazy t-class-image"
id="image"
lazyLoad="{{true}}"
mode="aspectFit"
showMenuByLongpress="{{false}}"
src="a.png"
style=""
webp="{{false}}"
bind:error="onLoadError"
bind:load="onLoaded"
/>
</wx-view>
<wx-image
ariaHidden="{{true}}"
ariaLabel=""
class="class t-class t-image t-image--shape-square t-image--lazy"
id="image"
lazyLoad="{{true}}"
mode="aspectFit"
showMenuByLongpress="{{false}}"
src="a.png"
style=""
webp="{{false}}"
bind:error="onLoadError"
bind:load="onLoaded"
/>
</t-image>
`;
2 changes: 2 additions & 0 deletions src/image/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ className | Description
-- | --
t-class | \-
t-class-load | \-
t-class-image | \-
t-class-error | \-

### CSS Variables

Expand Down
2 changes: 2 additions & 0 deletions src/image/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ load | - | 图片加载完成时触发
-- | --
t-class | 根节点样式类
t-class-load | 加载样式类
t-class-image | 图片样式类
t-class-error | 加载失败样式类

### CSS Variables

Expand Down
Loading
Loading