提交 ac21e214 编写于 作者: 张磊

补充transition测试用例

上级 8326e10f
...@@ -29,6 +29,10 @@ ...@@ -29,6 +29,10 @@
<text class="text">点击修改Transform</text> <text class="text">点击修改Transform</text>
<view class="base-style transition-transform" id="styleTransform" @click="changeTransform"></view> <view class="base-style transition-transform" id="styleTransform" @click="changeTransform"></view>
</view> </view>
<view class="container">
<text class="text">点击修改Transform和宽</text>
<view class="base-style transition-transform-width" id="styleTransformWithWidth" @click="changeTransformWithWidth"></view>
</view>
<view class="container" @click="changeTransformWithOrigin"> <view class="container" @click="changeTransformWithOrigin">
<text class="text">点击修改Transform(含transform-origin)</text> <text class="text">点击修改Transform(含transform-origin)</text>
<view class="base-style transition-transform" style="transform-origin: 0 0;" id="styleTransformWithOrigin"></view> <view class="base-style transition-transform" style="transform-origin: 0 0;" id="styleTransformWithOrigin"></view>
...@@ -61,6 +65,8 @@ ...@@ -61,6 +65,8 @@
styleBackground: null as UniElement | null, styleBackground: null as UniElement | null,
isTransitionStyleTransform: false, isTransitionStyleTransform: false,
styleTransform: null as UniElement | null, styleTransform: null as UniElement | null,
isTransitionStyleTransformWithWidth:false,
styleTransformWithWidth: null as UniElement | null,
isTransitionstyleBorder: false, isTransitionstyleBorder: false,
styleBorder: null as UniElement | null, styleBorder: null as UniElement | null,
isTransitionstylePosition: false, isTransitionstylePosition: false,
...@@ -82,6 +88,7 @@ ...@@ -82,6 +88,7 @@
this.stylePosition = uni.getElementById("stylePosition") this.stylePosition = uni.getElementById("stylePosition")
this.propertyStyleBackground = uni.getElementById("propertyStyleBackground") this.propertyStyleBackground = uni.getElementById("propertyStyleBackground")
this.styleTransformWithOrigin = uni.getElementById("styleTransformWithOrigin") this.styleTransformWithOrigin = uni.getElementById("styleTransformWithOrigin")
this.styleTransformWithWidth = uni.getElementById("styleTransformWithWidth")
}, },
methods: { methods: {
changeWidthOrHeight() { changeWidthOrHeight() {
...@@ -141,6 +148,17 @@ ...@@ -141,6 +148,17 @@
) )
this.isTransitionStyleTransform = !this.isTransitionStyleTransform this.isTransitionStyleTransform = !this.isTransitionStyleTransform
}, },
changeTransformWithWidth() {
this.styleTransformWithWidth?.style?.setProperty("transform", this.isTransitionStyleTransformWithWidth
? 'rotate(0deg)'
: 'rotate(135deg)'
)
this.styleTransformWithWidth?.style?.setProperty("width", this.isTransitionStyleTransformWithWidth
? '200px'
: '100px'
)
this.isTransitionStyleTransformWithWidth = !this.isTransitionStyleTransformWithWidth
},
changeTransformWithOrigin() { changeTransformWithOrigin() {
this.styleTransformWithOrigin?.style?.setProperty("transform", this.isTransitionStyleTransformWithOrigin this.styleTransformWithOrigin?.style?.setProperty("transform", this.isTransitionStyleTransformWithOrigin
? 'scaleX(1)' ? 'scaleX(1)'
...@@ -221,4 +239,8 @@ ...@@ -221,4 +239,8 @@
transition-property: left; transition-property: left;
transition-duration: 1s; transition-duration: 1s;
} }
.transition-transform-width {
transition-property: transform, width;
transition-duration: 1s;
}
</style> </style>
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册