日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 前端技术 > vue >内容正文

vue

vue Draggable实现拖动改变顺序

發(fā)布時間:2024/9/27 vue 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 vue Draggable实现拖动改变顺序 小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
  • npm install vuedraggable

  • import draggable from 'vuedraggable'

  • 示例代碼

  • Test.vue

    <template><ul class="sort-ul"><div>45454</div><draggable group="article" :value="sortArr" @input="handleListChange($event)"><li v-for="(item,index) in sortArr" :key="index"><h2>{{item.title}}</h2></li></draggable></ul> </template> <script> import Draggable from 'vuedraggable';export default {name: 'Test',props:{},data () {return {fileList: [],sortArr:[{title:"00"},{title:"01"},{title:"02"},{title:"03"},{title:"04"},{title:"05"},{title:"06"},{title:"07"},{title:"08"},{title:"09"},],}},components: {Draggable, },methods: {// 更新位置handleListChange(event){console.log(event);this.sortArr = event;}},mounted () {} } </script> <style>ul{padding: 0;width: 400px;}li{width: 100px;float:left;}</style>

    main.js

    import Vue from 'vue' import App from './App' Vue.config.productionTip = false/* eslint-disable no-new */ new Vue({el: '#app',components: { App },template: '<App/>' })

    app.vue

    <template><div id="app"><Test /></div> </template><script>import Test from '@/components/Test.vue'export default {name: 'App',components:{Test,},methods: {} } </script>

    總結

    以上是生活随笔為你收集整理的vue Draggable实现拖动改变顺序的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網(wǎng)站內(nèi)容還不錯,歡迎將生活随笔推薦給好友。