feat: support img lazy load.

pull/3445/head
ruibaby 2019-12-06 20:06:45 +08:00
parent 952176518e
commit 3531d58ac7
10 changed files with 6 additions and 21 deletions

View File

@ -107,6 +107,7 @@
<img
:src="item.thumbPath"
v-show="handleJudgeMediaType(item)"
loading="lazy"
>
</div>
<a-card-meta style="padding: 0.8rem;">

View File

@ -24,6 +24,7 @@
:src="attachment.path"
v-show="photoPreviewVisible"
style="width: 100%;"
loading="lazy"
>
</a>
<d-player

View File

@ -42,6 +42,7 @@
<img
:src="item.thumbPath"
v-show="handleJudgeMediaType(item)"
loading="lazy"
>
</div>
</a-col>

View File

@ -42,6 +42,7 @@
<img
:src="item.thumbPath"
v-show="handleJudgeMediaType(item)"
loading="lazy"
>
</div>
</a-col>

View File

@ -25,6 +25,7 @@
<img
:alt="item.name"
:src="item.screenshots"
loading="lazy"
>
</div>
<template

View File

@ -170,9 +170,6 @@ export default {
if (!this.postToStage.title) {
this.postToStage.title = moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')
}
if (!this.postToStage.originalContent) {
this.postToStage.originalContent = '开始编辑...'
}
if (this.postToStage.id) {
// Update the post
postApi.update(this.postToStage.id, this.postToStage, false).then(response => {

View File

@ -394,13 +394,6 @@ export default {
})
return
}
if (!this.selectedPost.originalContent) {
this.$notification['error']({
message: '提示',
description: '文章内容不能为空!'
})
return
}
// Set category ids
this.selectedPost.categoryIds = this.selectedCategoryIds
// Set tag ids

View File

@ -152,9 +152,6 @@ export default {
if (!this.sheetToStage.title) {
this.sheetToStage.title = moment(new Date()).format('YYYY-MM-DD-HH-mm-ss')
}
if (!this.sheetToStage.originalContent) {
this.sheetToStage.originalContent = '开始编辑...'
}
if (this.sheetToStage.id) {
sheetApi.update(this.sheetToStage.id, this.sheetToStage, false).then(response => {
this.$log.debug('Updated sheet', response.data.data)

View File

@ -210,13 +210,6 @@ export default {
})
return
}
if (!this.selectedSheet.originalContent) {
this.$notification['error']({
message: '提示',
description: '页面内容不能为空!'
})
return
}
if (this.selectedSheet.id) {
sheetApi.update(this.selectedSheet.id, this.selectedSheet, autoSave).then(response => {
this.$log.debug('Updated sheet', response.data.data)

View File

@ -85,7 +85,7 @@
@click="showDrawer(item)"
>
<div class="photo-thumb">
<img :src="item.thumbnail">
<img :src="item.thumbnail" loading="lazy">
</div>
<a-card-meta>
<ellipsis