We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
hello,大家好,我是德莱问,又和大家见面了,年后开工在即,新的一年新的气象,祝大家新年快乐,牛年大吉。
欢迎关注我的github,文章的更新和发布第一时间会在github进行
这是博客地址,欢迎+star
npm install transx or yarn add transx
<!-- 包裹动画元素 --> <trans-x :time="time" :delay="delay" :autoplay="autoplay" :loop="loop" :nextTransition="nextTransition" :prevTransition="prevTransition" ref="transx" @over="over" @transitionend="transitionEnd" > <div class="comp" v-for="(item, index) in items" :key="index" :index="index + 1"></div> </trans-x>
import TransX from "transx"; export default { components: { TransX }, data() { return { time: 0.6, loop: true, autoplay: 1000, delay: -1, nextTransition: "fadeIn", prevTransition: "fadeIn", defaultIndex: 0 } } }
over
over: function(isEnd) { console.log('边界到了', isEnd); }
** 说明:当边界为翻到第一页时isEnd为false,当边界为翻到最后一页时isEnd为true,
transitionend
transitionEnd: function(currentIndex) { console.log("当前到第几页了: ", currentIndex); }
goto
this.$refs.transx.goto(3); // 跳转到第四页
prev
// 不传参 this.$refs.transx.prev(); // 传参 this.$refs.transx.prev({ time: 0.6, delay: -1, transition: "moveLeftQuart", // 参考下面[支持动画种类] });
next
// 不传参 this.$refs.transx.next(); // 传参 this.$refs.transx.next({ time: 0.6, delay: -1, transition: "moveLeftQuart", // 参考下面[支持动画种类] });
目前共支持24种动画类型,具体选择哪种动画类型,可以参考例子codesanbox,多试试,说不定有意外惊喜哦。下面放几个例子给大家看看:
fadeIn
flip
shuttleRight
zoomRotateIn
谢谢大家阅读,再次祝大家新年快乐,牛年大吉
The text was updated successfully, but these errors were encountered:
No branches or pull requests
问个好
hello,大家好,我是德莱问,又和大家见面了,年后开工在即,新的一年新的气象,祝大家新年快乐,牛年大吉。
欢迎关注我的github,文章的更新和发布第一时间会在github进行
这是博客地址,欢迎+star
来个介绍
安装
使用
支持参数
支持事件
over
- 跳转到了边界后的回调,当在第一页继续上翻和在最后一页继续下翻时调用** 说明:当边界为翻到第一页时isEnd为false,当边界为翻到最后一页时isEnd为true,
transitionend
- 动画结束时的回调,在动画结束后调用,参数为当前的索引,值从0开始支持API
goto
- 跳转到第几页,参数为页码标识,索引从0开始prev
- 跳转到上一页next
- 跳转到下一页支持的动画类型
目前共支持24种动画类型,具体选择哪种动画类型,可以参考例子codesanbox,多试试,说不定有意外惊喜哦。下面放几个例子给大家看看:
fadeIn
flip
shuttleRight
zoomRotateIn
说明
the last
谢谢大家阅读,再次祝大家新年快乐,牛年大吉
The text was updated successfully, but these errors were encountered: