懒加载

master
fanluyan 2 years ago
parent dbf3c2abd4
commit 80a1b600be

Binary file not shown.

After

Width:  |  Height:  |  Size: 498 KiB

@ -16,7 +16,7 @@
<img v-if="index == 0" :src="item.path + '!1330x670'" />
<img
v-else
src="../../assets/img/nopic.jpg"
src="../../assets/img/loading.jpg"
:data-src="item.path + '!1330x670'"
class="swiper-lazy"
/>
@ -45,12 +45,29 @@
v-for="(item, index) in terminalPhoto"
:key="item.id"
>
<div class="bigimg" v-if="item.path.indexOf('nopic') == -1">
<!-- <img :src="item.path + '!1330x670'" alt="" /> -->
<img v-if="index == 0" :src="item.path + '!260x160'" />
<img
:src="item.path + '!260x160'"
v-else
src="../../assets/img/loading.jpg"
:data-src="item.path + '!260x160'"
class="swiper-lazy"
/>
</div>
<div class="bigimg" v-else>
<img :src="item.path" alt="" />
</div>
<!-- <img v-if="index == 0" :src="item.path + '!1330x670'" />
<img
src="item.path + '!260x160'"
alt=""
v-if="item.path.indexOf('nopic') == -1"
:data-src="item.path + '!260x160'"
class="swiper-lazy"
v-else-if="item.path.indexOf('nopic') == -1"
/>
<img :src="item.path" alt="" v-else />
<img :src="item.path" alt="" v-else /> -->
<p class="timeInfo" v-if="item.path.indexOf('nopic') == -1">
{{ $moment(item.photoTime).format("HH:mm:ss") }}({{
$moment(item.recvTime).format("HH:mm:ss")
@ -107,6 +124,17 @@ export default {
touchRatio: 0.2,
lazyLoading: true, //
slideToClickedSlide: true,
lazy: {
loadPrevNext: true,
loadPrevNextAmount: 3,
loadOnTransitionStart: true,
//loadOnTransitionStart: true,
},
observer: true, //swiperswiper
observeParents: true, //swiperswiper
onSlideChangeEnd: function (swiper) {
swiper.update();
},
//loop: true,
//loopedSlides: 4,
},

@ -102,7 +102,7 @@
<el-button type="primary" @click="handleShowErr"
>声光报警</el-button
>
<el-button type="primary" @click="handleShowErr"
<el-button type="primary" @click="handlehistoryPic"
>历史图片</el-button
>
@ -407,6 +407,11 @@ export default {
console.log(err); //
});
},
//
handlehistoryPic() {
this.$router.push({ path: "/realTimeSearch" });
// sessionStorage.setItem("keyPath", " realTimeSearch");
},
//
handlePanel() {
//const nodes = this.$refs.tree.getNode(this.currentNodekey).data; //

Loading…
Cancel
Save