animation.backgroundColor()
设置背景色
参数
参数名 |
类型 |
说明 |
string value |
string |
颜色值(目前只支持16进制) |
返回值
示例
<template>
<view>
<view class="block" c-animation="{{animationData}}" c-bind:click="handleClick">
<text>请点击我</text>
</view>
</view>
</template>
<script>
import { createAnimation } from "chameleon-api";
const animation = createAnimation();
class Index {
data = {
animationData: null,
}
methods = {
handleClick() {
this.animationData = animation
.backgroundColor('#000000').step({duration: 1000})
.export();
}
}
}
export default new Index();
</script>
<style scoped>
.block {
position: absolute;
width: 200cpx;
height: 200cpx;
background-color: #E3EDCD;
}
</style>
<script cml-type="json">
{
"base": {
"usingComponents": {}
}
}
</script>