Skip to content

Commit 882ac60

Browse files
committed
fix: 修复描述文字加载慢导致样式闪出的问题
1 parent 0b559c1 commit 882ac60

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

packages/fighting-components/image/src/image.vue

+3
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
<div
2222
v-if="caption"
23+
v-show="isLoadOk"
2324
class="f-image-caption"
2425
:style="{
2526
width: width || `${captionWidth}px`,
@@ -67,6 +68,7 @@
6768
const emit = defineEmits(Emits)
6869
6970
const isError: Ref<boolean> = ref<boolean>(true)
71+
const isLoadOk: Ref<boolean> = ref<boolean>(false)
7072
const isPreviewListShow: Ref<boolean> = ref<boolean>(false)
7173
const captionWidth: Ref<number> = ref<number>(0)
7274
const FImageImg: Ref<HTMLImageElement | null> = ref<HTMLImageElement | null>(
@@ -99,6 +101,7 @@
99101
width: number
100102
): void => {
101103
isError.value = params
104+
isLoadOk.value = params
102105
captionWidth.value = width
103106
}
104107

start/src/App.vue

+4-7
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
<f-image
44
root-margin="100px"
55
src="https://tianyuhao.cn/images/auto/1.png"
6+
err-src="https://fuss10.elemecdn.com/a/3f/3302e58f9a181d2509f3dc0fa68b0jpeg.jpeg"
67
:draggable="false"
78
lazy
89
alt="ada"
910
:preview-list="listImg"
1011
:select="true"
1112
:preview-z-index="10022"
13+
:modal-close="false"
14+
:show-close-btn="false"
1215
:preview-show-option="false"
1316
round="20px"
1417
preview-round="120px"
15-
caption="回到家啊回到家萨的好时机啊的话苏家爱华打算结婚的洒酒大数据坎大哈时间坎大哈时间的撒健康大数据坎大哈事件扩大化"
18+
caption="回到家啊回到家萨的好时机啊"
1619
:preview-show-index="32"
17-
block
1820
/>
1921
<span>12</span>
2022
</template>
@@ -47,11 +49,6 @@
4749
</script>
4850

4951
<style>
50-
html,
51-
body {
52-
width: 100%;
53-
height: 100%;
54-
}
5552
.list {
5653
width: 300px;
5754
height: 200px;

0 commit comments

Comments
 (0)