Swiper+animate使用笔记

2019-07-26  本文已影响0人  Wxh16144

Swiper+animate 使用笔记

Swiper 滑动插件使用

官方地址 https://www.swiper.com.cn

主要学习了 Swiper Animate 使用方法

地址https://www.swiper.com.cn/usage/animate/index.html
Swiper Animate 是 Swiper 中文网提供的用于在 Swiper 内快速制作 CSS3 动画效果的小插件,适用于 Swiper2.x、Swiper3.x 和 Swiper4.x 。

学习路线

$ npm init webpack test
$ npm install --save-dev sass-loader
//sass-loader依赖于node-sass
$ npm install --save-dev node-sass
{
   test: /\.scss$/,
   loaders: ['style', 'css', 'sass']
}
$ npm install swiper
<link rel="stylesheet" href="./static/animate.min.css" />
...
<script src="./static/swiper.animate.min.js"></script>
//App.vue
import Swiper from 'swiper' //在app.vue引入

new Swiper('.swiper-container', {}) //实例化

注:实例化后对象查看官方 API https://www.swiper.com.cn/api/index.html

使用总结

1 实例化需要在 dom 渲染完成后执行, vue mounted (){} ;钩子函数中使用

2 注意需要包裹两个壳!


swiper_tip.png
添加动画
<h1
class="ani animated"
swiper-animate-effect="rotateIn"
swiper-animate-duration="1s"
swiper-animate-delay="0s"
>
Swiper
</h1>

总结

对于个人来说又一阶段的实训已经结束,明显感觉到自己落下了很多东西没有深入挖掘,许多的知识点还是掌握的不太牢固。在以后的学习生活中,我会跟加努力的挖掘出更多的知识,课外知识是庞大的一个体系,我要努力进军其中,努力提高自己的能力。

上一篇 下一篇

猜你喜欢

热点阅读