注意: 使用之前请确定使用的swiper版本,避免走一些不必要的弯路(笔者踩过来的)本文采用的是vue3.0、swiper^8.1.0。

1、安装依赖

npm install swiper

2、vue文件引入

<template>
<swiper
:slides-per-view="3"
:navigation="{
nextEl: '.swiper-button-next', //前进后退按钮
prevEl: '.swiper-button-prev',
}"
:pagination="{ clickable: true }" //分页切换按钮
:autoplay="{ disableOnInteraction: false }" //自动播放
loop //开启循环
:scrollbar="{ draggable: true }"
class="teacher_ul"
>
<swiper-slide
class="teacher_li"
v-for="(item, index) in list"
:key="index"
>
<div class="teacher_pW">
<p class="teacher_p1">{{ item.category_name }}</p>
<p class="teacher_p2">- {{ item.category_desc }} -</p>
</div>
</swiper-slide>
</swiper>
</template>
import SwiperCore, {
Navigation,
Pagination,
Scrollbar,
Autoplay,
} from "swiper";
import { Swiper, SwiperSlide } from 'swiper/vue'
import "swiper/scss";
import "swiper/scss/navigation";
import "swiper/scss/pagination"; import { ref, defineComponent, reactive, onMounted, toRefs, nextTick } from 'vue' SwiperCore.use([Navigation, Pagination, Scrollbar, Autoplay]);
export default defineComponent({
name: 'index',
components: {
Swiper,
SwiperSlide
}
}

vue3使用swiper 完整步骤的更多相关文章

  1. Oracle 10g创建表空间的完整步骤详解

    本文我们主要介绍了Oracle 10g创建表空间的完整步骤,包括表空间的创建与删除.为应用创建用户以及权限的授予等操作,希望能够对您有所帮助. AD:WOT2014:用户标签系统与用户数据化运营培训专 ...

  2. idea14导入eclipse项目并部署运行完整步骤

    idea14导入eclipse项目并部署运行完整步骤 2015年05月12日 14:08:04 阅读数:40456 首先说明一下:idea里的project相当于eclipse里的workspace, ...

  3. CentOS 6 下升级安装Mysql 5.5 完整步骤

    使用系统CentOS 6.2本来已经系统自带安装了mysql 5.1,但是奈何5.1不支持utf8mb4字符集(详见:http://blog.csdn.net/shootyou/article/det ...

  4. 利用Docker搭建本地https环境的完整步骤

    利用Docker搭建本地https环境的完整步骤 这篇文章主要给大家介绍了关于如何利用Docker搭建本地https环境的完整步骤,文中通过示例代码将实现的步骤介绍的非常详细,对大家的学习或者工作具有 ...

  5. linux上安装启动elasticsearch-5.5.1完整步骤

    linux上安装启动elasticsearch-5.5.1完整步骤 学习了:https://blog.csdn.net/hingcheung/article/details/77144574 http ...

  6. 安装node.js 和 npm 的完整步骤

    vue 生命周期 1,beforeCreate 组件刚刚被创建 2,created 组件创建完成 3,beforeMount 挂载之前 4,mounted 挂载之后 5,beforeDestory 组 ...

  7. 【JDK】Linux安装源码包JDK完整步骤

    [JDK]Linux安装源码包JDK完整步骤 1.检查一下系统中的jdk版本 [root@localhost software]# java -version 显示: openjdk version ...

  8. 【转】apache 二级域名设置完整步骤

    原文链接:http://blog.sina.com.cn/s/blog_5375d76b01014fnt.html 最近在折腾网站二级域名的事情,在网上查了很多零碎的文档,不完整,有些也没有自己验证, ...

  9. flume自定义Source(taildirSource),自定义Sink(数据库),开发完整步骤

    一.flume简单了解推荐网站(简介包括简单案例部署): http://www.aboutyun.com/thread-8917-1-1.html 二.我的需求是实现从ftp目录下采集数据,目录下文件 ...

  10. 转《发布ionic应用到App Store的完整步骤 》

    当我们开发完一个应用,就到了发布到市场的时候,Android的打包比较简单,签名之后可以放在我们自己的服务器上,让用户扫描二维码来下载,而苹果的就比较麻烦了,如果内测可以通过蒲公英等内测分发平台,但是 ...

随机推荐

  1. React.js 修改文本中数字样式

    export function numberToColor(text, color = '#635BFF', size = '12px') { let reg = /(\d+)/g; return t ...

  2. 【Linux】常用

    查看端口占用 yum install lsof lsof -i:8080:查看8080端口占用 lsof abc.txt:显示开启文件abc.txt的进程 lsof -c abc:显示abc进程现在打 ...

  3. Java中类似c语言的printf

    System.out.printf("%4d",x); printf("%4d",x); 保留小数点后两位也可以用%.2f 相对来说很好记了 回车用\n

  4. Vmware-workstation - Centos8.0扩容磁盘空间 / 目录

    1. 软件版本 vmware workstation  15 pro 虚拟机: centos8.0 2.将虚拟机关机选择扩容到多大 3. 进入操作系统,执行lsblk查看sda盘的情况.下图所示,需要 ...

  5. js 俄罗斯方块 canvas

    俄罗斯方块背景- canvans 第一次写不知道说些什么好,直接上代码了@_@... jquery引入 <script src="https://cdn.bootcdn.net/aja ...

  6. LENGTH,LENGTHB

    LENGTH 1.语法 length(string) 2.说明: 统计字段的字符长度 3.示例: select length('abcd') from dual; --返回值:4 select len ...

  7. K8s validating data: the server could not find the requested resource ... with --validate=false

    转载: https://blog.csdn.net/yangchao1125/article/details/106193107/

  8. debian安装mate桌面环境的方法(图)

    debian安装mate桌面环境的方法(图) 2018年11月11日   |   浏览: 5199   |  来源:www.yangshengliang.com   debian安装时是可以选择桌面环 ...

  9. TCP通信实现两个主机之间的信息交互

    TCP通信概述TCP协议用来控制两个网络设备之间的点对点通信,两端设备按作用分为客户端和服务端.服务端为客户端提供服务,通常等待客户端的请求信息,有客户端请求到达之后,及时提供服务和返回响应消息:客户 ...

  10. python33

    Python逻辑运算符 Python语言支持逻辑运算符,以下假设变量 a 为 10, b为 20: 运算符 逻辑表达式 描述 实例 and x and y 布尔"与" - 如果 x ...