mirror of https://github.com/alibaba/ice.git
Fix/style not match (#6521)
* fix: fix style not match when hydrate * chore: add changeset
This commit is contained in:
parent
b748810588
commit
a04cc00242
|
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
'@ice/cache-canvas': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: fix style not match when hydrate
|
||||||
|
|
@ -119,10 +119,9 @@ export const CacheCanvas = forwardRef((props: CacheCanvasProps, ref) => {
|
||||||
{
|
{
|
||||||
(typeof fallback === 'function') && (<div
|
(typeof fallback === 'function') && (<div
|
||||||
id={`fallback-${id}`}
|
id={`fallback-${id}`}
|
||||||
style={isNode || Storage.getItem(cacheKey, { bizID }) ? { display: 'none' } : { display: 'block' }}
|
|
||||||
>
|
>
|
||||||
{
|
{
|
||||||
fallback()
|
(isNode || !Storage.getItem(cacheKey, { bizID })) && fallback()
|
||||||
}
|
}
|
||||||
</div>)
|
</div>)
|
||||||
}
|
}
|
||||||
|
|
@ -155,9 +154,9 @@ export const CacheCanvas = forwardRef((props: CacheCanvasProps, ref) => {
|
||||||
if (base64Data) {
|
if (base64Data) {
|
||||||
const img = document.getElementById('canvas-img-${id}');
|
const img = document.getElementById('canvas-img-${id}');
|
||||||
img && (img.src = base64Data);
|
img && (img.src = base64Data);
|
||||||
fallback && (fallback.style.display = 'none');
|
if (fallback && fallback.childNodes[0]) {
|
||||||
} else {
|
fallback.removeChild(fallback.childNodes[0]);
|
||||||
fallback && (fallback.style.display = 'block');
|
}
|
||||||
}
|
}
|
||||||
`,
|
`,
|
||||||
}}
|
}}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue