thewebkid / v-movable

A vue component or component wrapper that makes an element movable and its movements can be customized.
http://preview.thewebkid.com/modules/v-movable
22 stars 8 forks source link

Button Inside Movable #9

Open Brett-Riverboat opened 3 years ago

Brett-Riverboat commented 3 years ago

Is there a way to place a button on a movable that calls a method in your Vue component? I tried but the button just drags the component.

Here is a simple example: https://codesandbox.io/s/zealous-waterfall-ewln2?file=/src/App.vue

jeroendk commented 3 years ago

Add the following attribute to your button: move-disabled="true". This will prevent the click event on the button from being picked up by the movable lib.

<button move-disabled="true" @click="doSomething"></i>