Skip to content

Commit dbf7a05

Browse files
committed
fix: blog image lazyload
1 parent d07f92c commit dbf7a05

File tree

6 files changed

+10
-11
lines changed

6 files changed

+10
-11
lines changed

blog-view/src/components/blog/BlogItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<i class="small folder open icon"></i><span class="m-text-500">{{ item.category.name }}</span>
3535
</router-link>
3636
<!--文章Markdown描述-->
37-
<div class="typo m-padded-tb-small line-numbers match-braces rainbow-braces" v-html="item.description"></div>
37+
<div class="typo m-padded-tb-small line-numbers match-braces rainbow-braces" v-lazy-container="{selector: 'img'}" v-viewer v-html="item.description"></div>
3838
<!--阅读全文按钮-->
3939
<div class="row m-padded-tb-small m-margin-top">
4040
<a href="javascript:;" @click.prevent="toBlog(item)" class="color-btn">阅读全文</a>
@@ -72,4 +72,4 @@
7272

7373
<style scoped>
7474
75-
</style>
75+
</style>

blog-view/src/components/blog/BlogList.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div>
33
<!--content-->
4-
<BlogItem :blogList="blogList" v-viewer/>
4+
<BlogItem :blogList="blogList"/>
55
<!--分页-->
66
<Pagination :getBlogList="getBlogList" :totalPage="totalPage"/>
77
</div>
@@ -33,4 +33,4 @@
3333

3434
<style scoped>
3535
36-
</style>
36+
</style>

blog-view/src/views/about/About.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="ui top attached segment m-padded-lr-big">
44
<h2 class="m-text-500" style="text-align: center">{{ about.title }}</h2>
55
<meting-js server="netease" type="song" :id="about.musicId" theme="#25CCF7" v-if="about.musicId!==''"></meting-js>
6-
<div class="typo content m-margin-top-large" v-viewer v-html="about.content"></div>
6+
<div class="typo content m-margin-top-large" v-lazy-container="{selector: 'img'}" v-viewer v-html="about.content"></div>
77
</div>
88
<!--评论-->
99
<div class="ui bottom teal attached segment threaded comments">
@@ -53,4 +53,4 @@
5353
.content ul li {
5454
letter-spacing: 1px !important;
5555
}
56-
</style>
56+
</style>

blog-view/src/views/blog/Blog.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@
9191
import CommentList from "@/components/comment/CommentList";
9292
import {mapState} from "vuex";
9393
import {SET_FOCUS_MODE, SET_IS_BLOG_RENDER_COMPLETE} from '@/store/mutations-types';
94-
import {letsLazyload} from "@/util/lazyload";
9594
9695
export default {
9796
name: "Blog",

blog-view/src/views/friends/Friends.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
</div>
2020
<!--页面描述-->
2121
<div class="ui teal attached segment">
22-
<div class="typo content" v-viewer v-html="info.content"></div>
22+
<div class="typo content" v-lazy-container="{selector: 'img'}" v-viewer v-html="info.content"></div>
2323
</div>
2424
<!--评论-->
2525
<div class="ui bottom teal attached segment threaded comments">
@@ -112,4 +112,4 @@
112112
margin-top: 5px !important;
113113
margin-bottom: 7px;
114114
}
115-
</style>
115+
</style>

blog-view/src/views/moments/Moments.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<span style="font-weight: 700">{{ $store.state.introduction.name }}</span>
1515
<span class="right floated">{{ moment.createTime | dateFromNow }}</span>
1616
</div>
17-
<div class="content typo" :class="{'privacy':!moment.published}" v-viewer v-html="moment.content"></div>
17+
<div class="content typo" :class="{'privacy':!moment.published}" v-lazy-container="{selector: 'img'}" v-viewer v-html="moment.content"></div>
1818
<div class="extra content">
1919
<a class="left floated" @click="like(moment.id)">
2020
<i class="heart icon" :class="isLike(moment.id)?'like-color':'outline'"></i>{{ moment.likes }}
@@ -209,4 +209,4 @@
209209
.privacy {
210210
background: repeating-linear-gradient(145deg, #f2f2f2, #f2f2f2 15px, #fff 0, #fff 30px) !important;
211211
}
212-
</style>
212+
</style>

0 commit comments

Comments
 (0)