File tree Expand file tree Collapse file tree
dashboard/src/components/readers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 9090 class =" image-wrapper"
9191 :style =" imageWrapperStyles"
9292 >
93- <!-- 图片加载状态 -->
93+ <!-- 图片加载中覆盖层 -->
9494 <div v-if =" !image.loaded && !image.error" class =" image-loading" >
9595 <a-spin :size =" 24" />
9696 <div class =" loading-text" >加载中...</div >
9797 </div >
9898
99- <!-- 图片加载错误 -->
100- <div v-else- if =" image.error" class =" image-error" >
99+ <!-- 图片加载错误覆盖层 -->
100+ <div v-if =" image.error" class =" image-error" >
101101 <icon-image />
102102 <div class =" error-text" >图片加载失败</div >
103103 <a-button size =" small" @click =" retryImage(index)" >重试</a-button >
104104 </div >
105105
106- <!-- 图片内容 -->
106+ <!-- 始终渲染 img,浏览器自然加载 -->
107107 <img
108- v-else
109108 :src =" image.url"
110109 :alt =" `第${index + 1}页`"
111110 class =" comic-image"
111+ :class =" { hidden: !image.loaded || image.error }"
112112 :style =" imageStyles"
113113 @load =" handleImageLoad(index)"
114114 @error =" handleImageError(index)"
115115 @click =" handleImageClick(index)"
116+ loading =" lazy"
116117 />
117118
118119 <!-- 图片序号 -->
@@ -945,7 +946,13 @@ onUnmounted(() => {
945946 border- radius: 8px ;
946947 box- shadow: 0 2px 8px var (-- color- border- 3 );
947948 cursor: pointer;
948- transition: transform 0 .2s ease;
949+ transition: transform 0 .2s ease, opacity 0 .3s ease;
950+ }
951+
952+ .comic - image .hidden {
953+ opacity: 0 ;
954+ position: absolute;
955+ pointer- events: none;
949956}
950957
951958.comic - image: hover {
You can’t perform that action at this time.
0 commit comments