Skip to content

Commit

Permalink
fix(Image): remove style and customStyle to root dom
Browse files Browse the repository at this point in the history
  • Loading branch information
anlyyao committed Sep 10, 2024
1 parent 56aef96 commit 84b1e0f
Show file tree
Hide file tree
Showing 4 changed files with 217 additions and 191 deletions.
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>
`;
Loading

0 comments on commit 84b1e0f

Please sign in to comment.