组件官网
http://www.sortablejs.com
添加依赖
npm install sortablejs --save
页面使用
template
<ul style="margin-right: 40px;" ref="blogUl">
<li @click="liClick(item.id)" :data-id="item.id" style="list-style-type:none;" v-for="item in list" :key="item.id">
<el-card class="box-card">
<div class="text item">
{
{item.title }}
</div>
</el-card>
</li>
</ul>
script
import Sortable from "sortablejs";
Sortable.create(this.$refs.blogUl, {
animation: 150,
ghostClass: 'blue-background-class',
group: "localStorage-example",
store: {