首先下载依赖包 npm install vuedraggable -S
npm install vuedraggable -S
然后在需要的页面引入并注册,使用即可
<template>
<div class="demo">
<table class="dataTabble">
<thead>
<tr>
<th width="110">序号</th>
<th width="200">内容</th>
<th width="160">操作</th>
/tr>
</thead>
<draggable v-model="demoList" element="tbody" :move="getData" @update="dragData">
<tr v-for="(item,id) in demoList" :key="id">
<td>{
{id}}</td>
<td>{
{item.content}}</td>
<td>