我正在像游戏这样的跳棋上实现拖放,一切正常......直到棋盘旋转,然后所有 dnd 和实现都被破坏:当我将一块拖到顶部时,该块落到底部,什么时候被拖向左,向右。
问题示例代码 https://stackblitz.com/edit/angular-h3xixz?file=src%2Fstyles.scss
这是打破dnd行为的css片段,但我真的需要在游戏过程中动态地旋转棋盘。
.basic-container {
padding: 30px;
transform: rotate(180deg);
}
我不想放弃@angular/cdk 实现,但也许我别无选择,我快疯了。
更新
为了更清楚地说明问题,我附上了一个带有动画的示例来旋转容器。我已经有一个解决方法,我将在答案中分享。