本文小编为大家详细介绍“Vue.Draggable拖拽功能怎么配置”,内容详细,步骤清晰,细节处理妥当,希望这篇“Vue.Draggable拖拽功能怎么配置”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。
使用cmd命令在项目根目录下下载安装Vue.Draggable
npm install vuedraggable
在组件中需要使用的引入
import draggable from 'vuedraggable'
注册组件
components:{ draggable }
vue的template代码如
<draggable v-model="itemlis" //开始移动方法 :move="getdata" @update="datadragEnd" //参数配置 :options="{animation: 60,handle:'.drag-icon'}" > <transition-group> <el-row class="album-list-list-item" v-for="(item,index) in itemlis" :key="item.id"> <el-col :span="13"> <div class="grid-content "> <i class="icon drag-icon iconfont icon-Icon-tuozhuai"></i> <el-checkbox v-model="item.checked" :value="item.id"></el-checkbox> <span class="album-info-net">{{item.net}}</span> </div> </el-col> <el-col :span="4"> <div class="grid-content "> <span>{{item.time}}</span> </div> </el-col> <el-col :span="4"> <el-popover placement="left-start" visible-arrow=false width="120" trigger="hover" > <div class="code-img"> <img src="../assets/images/1.png"/> </div> <span slot="reference">{{item.wqcode}}</span> </el-popover> </el-col> <el-col :span="3"> <div class="grid-content album-l-l-tool "> <div class="more-tip-op"> <el-dropdown> <span class="el-dropdown-link"><em class="el-icon-more"></em></span> <el-dropdown-menu slot="dropdown" > <el-dropdown-item :data-url="item.opUrl.removeUrl" @click.native="moveTo(item,$event)">移动</el-dropdown-item> <el-dropdown-item :data-url="item.opUrl.copyUrl" @click.native="copyTo(item,$event)">复制</el-dropdown-item> <el-dropdown-item @click.native="itemDel(index,$event)" :data-url="item.opUrl.delUrl">删除 </el-dropdown-item> <el-dropdown-item :data-url="item.opUrl.exportUrl">导出</el-dropdown-item> <el-dropdown-item :data-url="item.opUrl.editName" @click.native="getEditDialog(item,$event)">编辑</el-dropdown-item> <el-dropdown-item @click.native="getCodeDialog(item,$event)" >查看二维码</el-dropdown-item> </el-dropdown-menu> </el-dropdown> </div> </div> </el-col> </el-row> </transition-group> </draggable>
读到这里,这篇“Vue.Draggable拖拽功能怎么配置”文章已经介绍完毕,想要掌握这篇文章的知识点还需要大家自己动手实践使用过才能领会,如果想了解更多相关内容的文章,欢迎关注亿速云行业资讯频道。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。