关于本站
“最难不过坚持”
本人承接扒站仿站,php网站维护,病毒查杀,网站编辑,网站改版,html制作
有需要网站维护,改版,病毒查杀,网站编辑,网站备案,html制作等相关的工作可以联系我。
本人有多年相关工作经验,也可提供免费咨询,交个朋友。
有需要探讨问题的朋友,也可以加我微信,共同探讨!
微信:15011482830 QQ:408917339
2712
39
分类目录
最新评论
- https://jueru.net/
-
评 留言
- :weixiao:
-
评 留言
- :shuijiao: :weiqu: :zhenbang: :leng:
-
评 留言
- :yiwen: :yiwen: :yiwen: :yiwen:
-
评 EasySass: could not generate CSS file. See Output panel for details.
- 这个业务逻辑多少都有点奇怪了,阅读浏览次数增值在新闻详情页的控制器方法里setInc,这怎么还写进模型事件里了。如果非要用onAfterRead也可以,把新闻文章的内容单独分出来一个news_content表,然后把它和news做关联,然后给news_content表的onAfterRead事件做增值处理,这样点进新闻页内查询到文章内容时才会触发它。
-
评 TP6模型事件-查询后onAfterRead不好用
文章标签更多
打开边栏(ESC)
关闭边栏(ESC)
解决方法 我使用的是Swiper 4.5.0版本,
因为swiper默认点击后不自动轮播所以要设置一下
因为swiper默认点击后不自动轮播所以要设置一下
autoplay: { disableOnInteraction: false }
$(function(){
var swiper = new Swiper('.swiper-container', {
// autoplay:true,
loop:true,
pagination: {
el: '.swiper-pagination',
clickable: true,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
autoplay: { disableOnInteraction: false }
});
})
vue中,自定义轮播图组件
<template>
<div class="swiper-container" ref="mySwiper">
<div class="swiper-wrapper">
<!-- 遍历 一个数组list, 这个list数组里的数据取决于 父元素传过来的数据, 其他没太大改动,还是swiper结构 -->
<div
class="swiper-slide"
v-for="(carousel, index) in carouselList"
:key="carousel.id"
>
<img :src="carousel.imgUrl" />
</div>
</div>
<!-- 如果需要分页器 -->
<div class="swiper-pagination"></div>
<!-- 如果需要导航按钮 -->
<div class="swiper-button-prev"></div>
<div class="swiper-button-next"></div>
</div>
</template>
<script>
import Swiper from "swiper"; // 引入 swiper
export default {
name: "Carousel",
props: ["carouselList"], //接受父组件传来的数据
//这个watch对象会对, Floor组件与首页轮播图组件都能生效, 也因此才能封装全局组价
watch: {
carouselList: {
immediate: true,
// 在new swiper实例之前, 页面中结构必须已经存在
handler() {
this.$nextTick(() => {
// 当执行这个回调的时候: 保证服务器的数据一定回来了(这时候v-for已经执行完毕了)
var mySwiper = new Swiper(this.$refs.mySwiper, {
loop: true, // 循环模式选项
// autoplay:true,
autoplay: {
delay: 3000,
stopOnLastSlide: false,
disableOnInteraction: false, // true点击后不自动轮播,false点击后自动轮播
},
// 如果需要分页器
pagination: {
el: ".swiper-pagination",
clickable: true,
},
// 如果需要前进后退按钮
navigation: {
nextEl: ".swiper-button-next",
prevEl: ".swiper-button-prev",
},
})
})
},
},
},
}
</script>
<style>
</style>
赏
相关推荐
Uncaught (in promise) 的解决方法,可能原因
Uncaught (in promise) 的解决方法,可能原因;仅仅只是一种参考原因
我是因为copy的项目直接修改的,结果一直报错 Uncaught (in promise),检查发现接口请求数据已经正常返回,后来经过排查发现是在拦截器里面别人的判断是response.data.status !== 1 就算请求失败,从而Promi...
钉钉怎样设置快捷键?钉钉系统设置在哪
钉钉怎样设置快捷键?
1,打开电脑端钉钉面板,点击右上角自己的头像,下拉菜单中点击系统设置
2,进入系统设置面板,下拉滚动条,找到快捷键设置
评论加载中...