Brendon Muir
Brendon Muir

Reputation: 4612

Is it possible to set default options for vue.draggable?

I was wondering if it is possible to set default options for Vue.draggable? Currently I find I need to keep supply the options for each draggable when some (like the handle and scroll sensitivity) would be better set globally.

%draggable{ 'v-model': 'values', '@change': 'move', ':options': '{handle: ".handle", scrollSensitivity: 80}', 'element': 'tbody' }

Excuse the HAML.

Upvotes: 0

Views: 568

Answers (1)

David Desmaisons
David Desmaisons

Reputation: 1006

It is not possible, You can use a store to keep the default parameters and reuse them in diferent components. Note that starting with version 2.19 the syntax is:

v-bind="{handle: '.handle', scrollSensitivity: 80}"

Or

handle=".handle" :scrollSensitivity="80"

Upvotes: 1

Related Questions