vue时钟组件_一个简单的vue时钟组件
关键的 less 代码
<style lang="less" scoped>
@angle: 30deg;
/* 定义时钟数组 */
@timeList: 1,2,3,4,5,6,7,8,9,10,11,12;
each(@timeList, {
.hour:nth-of-type(@{value}) {
transform: rotatez(@angle * (@value - 1));
> span {
transform: rotatez(-@angle * (@value - 1));
}
}
});
</style>