当前位置:网站首页>Wiper component encapsulation
Wiper component encapsulation
2022-04-23 16:59:00 【Endless cake】
swiper Components
<!-- Component calls -->
<ui-swipe :product-image="swiperList" :img-event="showImageViewer" key-name="imageUrl"></ui-swipe>
<!-- Component content -->
<template>
<div class="swipe" @click="imgEvent" style="visibility: 'visible' !important">
<div class="swipe-wrap">
<div class="swiper-container">
<div class="swiper-wrapper">
<figure class="swiper-slide" v-for="(pic, picIndex) in productImage" :key="picIndex" >
<template v-if="pic.linkUrl">
<a :href="pic.linkUrl || 'javascript:void(0)'">
<img
class="h100per"
alt="pic"
:src="pic[keyName]?pic[keyName]:defaultPic"
style="visibility: 'visible' !important"
/>
</a>
</template>
<template v-if="!pic.linkUrl">
<img
class="h100per"
alt="pic"
:src="pic[keyName]?pic[keyName]:defaultPic"
style="visibility: 'visible' !important"
/>
</template>
</figure>
</div>
<div class="swiper-pagination swiper-pagination-red"></div>
</div>
</div>
<slot></slot>
</div>
</template>
<script>
export default {
props: ['productImage', 'imgEvent', 'keyName', 'defaultPic'],
mounted() {
var that = this
Vue.nextTick(function() {
setTimeout(() => {
// eslint-disable-next-line no-undef
new Swiper('.swiper-container', {
autoplay: {
// Auto play
delay: 3000, // 3s
stopOnLast: false, // The last frame plays automatically
disableOnInteraction: false // It can also play normally after manual sliding
},
loop: that.productImage.length > 1, // Roll back
pagination: {
// Configure small points
el: '.swiper-pagination',
clickable: true
}
})
}, 200)
})
},
methods: {}
}
</script>
版权声明
本文为[Endless cake]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204230554520020.html
边栏推荐
- Handwritten event publish subscribe framework
- SPC introduction
- Sub database and sub table & shardingsphere
- 详解牛客----手套
- Freecodecamp ---- budget & category exercise
- Shell脚本——Shell编程规范及变量
- Path environment variable
- Derivation of Σ GL perspective projection matrix
- English | day15, 16 x sentence true research daily sentence (clause disconnection, modification)
- ACL 2022 | DialogVED:用于对话回复生成的预训练隐变量编码-解码模型
猜你喜欢
Shell script -- shell programming specification and variables
Installation and management procedures
How much do you know about the process of the interview
Detailed explanation of the penetration of network security in the shooting range
Feign report 400 processing
Milvus 2.0 質量保障系統詳解
True math problems in 1959 college entrance examination
Mock test
English | day15, 16 x sentence true research daily sentence (clause disconnection, modification)
Sub database and sub table & shardingsphere
随机推荐
Go language, array, string, slice
Zhimeng dedecms security setup Guide
手写事件发布订阅框架
True math problems in 1959 college entrance examination
昆腾全双工数字无线收发芯片KT1605/KT1606/KT1607/KT1608适用对讲机方案
PostgreSQL column storage and row storage
VsCode-Go
Use case execution of robot framework
Installation and management procedures
Kingdee Cloud Star API calling practice
扫码登录的原理你真的了解吗?
∑GL-透视投影矩阵的推导
MySQL master-slave synchronization pit avoidance version tutorial
websocket
Read a blog, re understand closures and tidy up
How vscode compares the similarities and differences between two files
计算饼状图百分比
◰ GL shader handler encapsulation
Pseudo Distributed installation spark
SQL: How to parse Microsoft Transact-SQL Statements in C# and to match the column aliases of a view