setup中定义变量以及在style中的使用(有单位的需要calc 计算)

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>

相关文章:

  • 2022-12-23
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-07
  • 2022-12-23
  • 2021-09-10
猜你喜欢
  • 2022-12-23
  • 2020-05-27
  • 2022-12-23
  • 2021-11-11
  • 2021-09-04
相关资源
相似解决方案