该仓库是在 turn.js 的基础上做了改动
- 翻页可以支持整个侧边,而不仅仅只能从四个角进行翻页
- 支持 vue2
1.安装
npm install turnjs-vue
2.局部导入
<template>
<Flip>
<div class="flip-item-demo">1</div>
<div class="flip-item-demo">2</div>
<div class="flip-item-demo">3</div>
</Flip>
<template>
<script>
import Flip from "turnjs-vue";
export default {
components: {
Flip
}
}
</script>
<style>
.flip-item-demo {
width: 400px;
height: 400px;
background-color: red;
}
</style>
options: 参考 turn.js 的 Options disable: Boolean, 是否禁用滑动(可以自己调用 nextPage 进行翻页) wrapperClass: 自定义 wrapper 的 class
# example
import {nextPage} from 'turnjs-vue'
// 功能:下一页
// 当最后一页调用该函数时返回 false
interface nextPage {
(): boolean
}
// 功能:上一页
// 当第一页调用该函数时返回 false
interface previousPage {
(): boolean
}
// interface toPage {
(index: number): void
}