提交 b27bbe7c 编写于 作者: 张磊

调整transition示例,添加异步创建view的示例

上级 9c3ba1ad
<template> <template>
<!-- #ifdef APP --> <!-- #ifdef APP -->
<scroll-view style="flex:1;"> <scroll-view style="flex:1;" v-if="isShow">
<!-- #endif --> <!-- #endif -->
<image class="transition-transform" id="transition-transform" @transitionend="onEnd" src="/static/uni.png"></image> <image class="transition-transform" id="transition-transform" @transitionend="onEnd" src="/static/uni.png"></image>
<text class="adjust">对图片设置transform进行旋转,在旋转完成的transitionend事件后,继续旋转</text> <text class="adjust">对图片设置transform进行旋转,在旋转完成的transitionend事件后,继续旋转</text>
...@@ -18,9 +18,24 @@ ...@@ -18,9 +18,24 @@
element: null as UniElement | null, element: null as UniElement | null,
isStart: false, isStart: false,
buttonValue: "开启图片旋转", buttonValue: "开启图片旋转",
onTransitionEndTriggr: false onTransitionEndTriggr: false,
isShow: false
} }
}, },
onReady() {
// #ifdef APP-ANDROID
var that = this
class ThreadRunnable extends Runnable {
override run() {
that.isShow = true
}
}
new Thread(new ThreadRunnable()).start()
// #endif
// #ifndef APP-ANDROID
this.isShow = true
// #endif
},
methods: { methods: {
switchBtn() { switchBtn() {
if (!this.isStart) { if (!this.isStart) {
...@@ -53,10 +68,11 @@ ...@@ -53,10 +68,11 @@
</script> </script>
<style> <style>
.adjust { .adjust {
margin: 10px; margin: 10px;
} }
.transition-transform {
.transition-transform {
width: 200px; width: 200px;
height: 200px; height: 200px;
margin: 25px auto; margin: 25px auto;
...@@ -65,5 +81,5 @@ ...@@ -65,5 +81,5 @@
transition-property: transform; transition-property: transform;
transition-timing-function: linear; transition-timing-function: linear;
transform: rotate(0deg); transform: rotate(0deg);
} }
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册