基础过渡动画
<template> <view> <uni-section title="基础过渡动画" type="line"></uni-section> <view class="example-body"> <button @click="open(['slide-top'])">slide-top</button> <button @click="open(['slide-left'])">slide-left</button> <button @click="open(['slide-right'])">slide-right</button> <button @click="open(['slide-bottom'])">slide-bottom</button> <button @click="open(['fade'])">fade</button> <button @click="open(['zoom-in', 'fade'])">zoom-in</button> <button @click="open(['zoom-out', 'fade'])">zoom-out</button> </view> <uni-transition :duration="500" :mode-class="modeClass" :styles="transfromClass" :show="transShow" @click="onTap"> <text style="color: #fff;padding: 40px;background-color: #4CD964;">Test</text> </uni-transition> </view> </template> <script> export default { components: {}, data() { return { transShow: false, modeClass: ['fade'], maskClass: { position: 'fixed', bottom: 0, top: 0, left: 0, right: 0, 'background-color': 'rgba(0, 0, 0, 0.4)' }, transfromClass: { position: 'fixed', bottom: 0, top: 0, left: 0, right: 0, display: 'flex', 'justify-content':'center', 'align-items': 'center' } }; }, onLoad() {}, methods: { open(mode) { this.modeClass = mode; this.transShow = !this.transShow; }, onTap() { this.transShow = false; } } }; </script>
组合过渡动画
<template> <view> <view class="example-body"> <button @click="open(['fade','zoom-out','slide-top'])">组合动画示例一</button> <button @click="open(['zoom-in','slide-bottom','fade'])">组合动画示例二</button> <button @click="open(['slide-left','slide-top','fade'])">组合动画示例三</button> </view> <uni-transition :mode-class="modeClass" :styles="transfromClass" :show="transShow" @click="onTap" :duration="500"> <text style="color: #fff;padding: 40px;background-color: #4CD964;">Test</text> </uni-transition> </view> </template> <script> export default { components: {}, data() { return { transShow: false, modeClass: ['fade'], maskClass: { 'position': 'fixed', 'bottom': 0, 'top': 0, 'left': 0, 'right': 0, 'background-color': 'rgba(0, 0, 0, 0.4)', }, transfromClass: { 'position': 'fixed', 'bottom': 0, 'top': 0, 'left': 0, 'right': 0, 'display': 'flex', 'justify-content': 'center', 'align-items': 'center' } } }, onLoad() {}, methods: { open(mode) { this.modeClass = mode this.transShow = !this.transShow }, onTap() { this.transShow = this.show = false } } } </script>
网友回复
python如何调用openai的api实现知识讲解类动画讲解视频的合成?
html如何直接调用openai的api实现海报可视化设计及文本描述生成可编辑海报?
f12前端调试如何找出按钮点击事件触发的那段代码进行调试?
abcjs如何将曲谱播放后导出mid和wav格式音频下载?
python如何将曲子文本生成音乐mp3或wav、mid文件
python中mp3、wav音乐如何转成mid格式?
js在HTML中如何将曲谱生成音乐在线播放并下载本地?
python如何实现在windows上通过键盘来模拟鼠标操作?
python如何给win10电脑增加文件或文件夹右键自定义菜单?
python如何将音乐mp3文件解析获取曲调数据?