美文网首页
vue3.0 动态css变量的使用

vue3.0 动态css变量的使用

作者: 如果俞天阳会飞 | 来源:发表于2021-07-23 14:24 被阅读0次
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>

相关文章

网友评论

      本文标题:vue3.0 动态css变量的使用

      本文链接:https://www.haomeiwen.com/subject/hrxpmltx.html