Closed Doogiemuc closed 2 years ago
How can I pass the whole element object into my draggable components.
The items that I want to drag are vue3-components. I can pass individual attributes of the current element. But how can I pass the whole element?
let proposalsInBallot = [ { id: 4711, title: "Some title", ... }, { id: 4712, title: "Another title", ... }, { id: 4713, title: "And one more title", ... }, ]; <draggable v-else id="myDraggable" v-model="proposalsInBallot" class="draggable" item-key="id" :disabled="loading || castVoteLoading" :swap-threshold="0.5" :delay="40" :animation="500" :can-scroll-x="false" > <template #item="{prop}"> <law-panel ref="proposalInBallot" :law="prop" // <======== how to do this??? :read-only="true" :collapse="true" /> </template> </draggable>
It looks like that undefined is passed.
I also tried :law="{prop}. Then an empty object is passed
:law="{prop}
How can I pass the whole "prop" object into my vue-component "law-panel"
Ok, I tried again and now I worked as shown in the code above. :law="prop". (no curly braces)
:law="prop"
How can I pass the whole element object into my draggable components.
The items that I want to drag are vue3-components. I can pass individual attributes of the current element. But how can I pass the whole element?
It looks like that undefined is passed.
I also tried
:law="{prop}
. Then an empty object is passedHow can I pass the whole "prop" object into my vue-component "law-panel"