vue.js 2.0을 사용하고 Vue.Draggable을 사용하여 드래그 가능한 테이블을 만들었습니다. 오류가 없지만 tr
을 끌려고하면 이동하지 않습니다. 하지만 div
을 사용하여 이동했습니다. 내가 놓친 게 있니?vue.js에서 드래그 가능한 테이블 tr이 이동되지 않았습니다
index.html을
<div id="service-list">
<table>
<draggable :list="services" :element="'tbody'">
<tr v-for="service in services">
<td>{{ service.name }}</td>
<td>{{ service.price }}</td>
</tr>
</draggable>
</table>
</div>
내가이 같은 문제로 실행
var service_list = new Vue({
el: '#service-list',
data: {
services: []
},
mounted: function() {
var that = this;
$.get({
url: 'use my url',
success: function(res) {
that.services = res;
}
})
}
https://github.com/SortableJS/Vue.Draggable/issues/61 이렇게하면 문제가 거의 해결됩니다. 테이블과 td를 자신의 구성 요소로 포장해야하는 것처럼 보입니다. –