问题
I would like to create draggable (free) buttons in Ionic. In ionic 3 I used a directive to do this (link https://www.joshmorony.com/building-an-absolute-drag-directive-in-ionic-2/) but this directive don't works in ionic 5 and it does not give any errors. What do you think is the best library (supported from some tutorial) for ionic 5 to do this? Thanks in advance.
回答1:
This does not have to be Ionic specific. If you are using angular you can just use an NPM component such as https://www.npmjs.com/package/angular-draggable-droppable
There is also support for this in Angular Material library
https://material.angular.io/cdk/drag-drop/overview
来源:https://stackoverflow.com/questions/62580511/how-to-drag-elements-in-ionic-4-5