Vue js Drag and Drop Customizable list – step by step

Vue js Drag and Drop Customizable list – step by step

In this Post We Will Explain About is Vue js Drag and Drop Customizable list – step by step With Example and Demo.

Welcome on infinityknow.com – Examples ,The best For Learn web development Tutorials,Demo with Example! Hi Dear Friends here u can know to Vuejs ui drag and drop list step by step

In this post we will show you Best way to implement Vuejs draggable droppable Example, hear for How to drag and drop div using Vuejs Example with Download .we will give you demo,Source Code and examples for implement Step By Step Good Luck!.

READ :  Angular Router Get current URL Query String parameters

index.html

[php]

{{mytext}}

livedataidea

[/php]

index.js

[php]

new Vue {
el: ‘#product-list’
data: {
datalist: [1 to 5].map -> {mytext: “Item-#{it}”, qqq:it}
_dragElem: null
_data_add: null
_livedataidea: document.getElementById ‘livedataidea’
}
//here call a methods
methods: {
reorder: !->
sty_param = document.createElement(‘style’);
document.head.appendChild sty_param

sty_param.appendChild (document.createTextNode ”)
s = sty_param.sheet
//for loop
for num from 0 to this.datalist.length
e = num
if this._dragElem?
code_index = this._dragElem.$index
–e if code_index
this._dragElem = ev.targetVM
this._dragNode = ev.target

this.reorder!
st = this._dragNode.style
Vue.nextTick !->
st.opacity = 0
st.height = 0
this.$el.insertBefore this._livedataidea, ev.target
#ev.preventDefault! #
#console.log \dragend
this.$el.removeChild this._livedataidea
this._dragNode.style.opacity = 1
this._dragNode.style.height = ’50px’

this._dragNode = null
this._dragElem = null

this.reorder!
ev.preventDefault!
drop: (ev) !->
#console.log \drop
data_add = this._data_add
code_index = this._dragElem.$index
return if code_index == data_add

READ :  Vue Drag and Drop Sortable Example - Vuejs Draggable

removed = this.datalist.splice code_index, 1
this.datalist.splice data_add, 0, removed[0]

this.dragend ev

//call a dragover functions
dragover: (ev) !->
#console.log \over
ev.preventDefault!
return true
//call a dragenter functions
dragenter: (ev) !->
code_index = this._dragElem.$index
data_add = ev.targetVM.$index
this._data_add = data_add

# FIXME
larg_param = if code_index
this.reorder!
}

[/php]

Example

I hope you have Got Vuejs – Drag and drop elements from list into separate blocks And how it works.I would Like to have FeadBack From My Blog(infinityknow.com) readers.Your Valuable FeadBack,Any Question,or any Comments abaout This Article(infinityknow.com) Are Most Always Welcome.

Leave a Comment