vue3.0 动态css变量的使用
时间:2021-07-08 09:58:28
收藏:0
阅读:117
setup() {
const rotate = ref<number>(0);
const color: string = "red";
const changeStatus = (): void => {
rotate.value = -90;
};
return {
rotate,
color,
};
},
<style>
.test {
color: v-bind(color);
transform: rotateX(calc(v-bind(rotate) * 1deg))
}
</style>