您好,登錄后才能下訂單哦!
本文小編為大家詳細介紹“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進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。