Can't get options to work
See original GitHub issueI suppose I’m overlooking something obvious, but I simply can’t get options to work.
I have a vue2 project containing a simple drag and drop which allows reordering items in a list:
<div id="drag-container" v-dragula="items" bag="items">
<div v-for="(item, index) in item" :key="item.id" class="row">
<div class="col drag-handle">
<div class="drag-icon"></div>
</div>
... item contents here ...
</div>
</div>
Drag and drop works fine, but I want to allow dragging only via specific handle. I can use the moves
option of dragula to control that, but I can’t get it working in vue2-dragula
. I tried things like:
Vue.$dragula.$service.options('items', {
moves: function (el, source, handle, sibling) {
console.log('moves', el);
return el.classList.contains('drag-handle')
}
})
and
beforeMount: function () {
this.$dragula.$service.options('items', {
moves: function (el, source, handle, sibling) {
console.log('moves', el);
return el.classList.contains('drag-handle')
}
})
},
But the moves function is never invoked. Any idea what I’m overlooking?
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
"Options" option not working - Microsoft Community
I'm using Excel 365. I want to access the "options" feature. When I click "file" then "options", the menu simply disappears and I'm...
Read more >Options Orders Not Getting Filled? Try These 3 Adjustments
Check out these 3 easy adjustments to help get your options orders filled quickly.
Read more >WHY WON'T MY OPTIONS ORDER GET FILLED? - YouTube
In today's video, I want to talk about why your options order isn't getting filled. Options trading can be a great way to...
Read more >How To Avoid Closing Options Below Intrinsic Value
Closing Long Call Positions. Naturally, you can try to place a limit order to sell at $5.70 (or more reasonably, $5.60—leaving a dime...
Read more >Common Pitfalls for New Options Traders | Charles Schwab
When you first begin trading options, you may realize that you have additional capital to put to work that may have been tied...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Great to hear! I’ve added it to the new Wiki page with usage examples
Feel free to help improve the library and the docs!
Ok managed to get it working (starting from one of the working examples from the demo app). The name of the service and drake should match with the created service, and the structure of the created service has to be correct.
Thanks for your help Kristian.