vue3 拖拽插件 vue.draggable.next

hykeda3年前Vue3166

官网地址:https://github.com/SortableJS/vue.draggable.next

安装:

npm i -S vuedraggable@next

引入插件:

import draggable from 'vuedraggable'

基础使用:

<draggable v-model="myArray" item-key="id">
  <template #item="{element}">
      <div> {{element.name}} </div>
  </template>
</draggable>

const myArray = [
    {name:'123',id:1},
    {name:'456',id:2} 
]

配置信息请看官网说明

相关文章

vite.config.js配置@

import { defineConfig } from 'vite'import vue from '@vitejs/plugin-vue'import path f...

pinia中数据解构

在vuex中获取state中的数据可以解构的方式如下:import { mapState,mapMutations } from "vuex...

页面直接使用ElementUI,官方提供的表格代码,样式错乱

页面直接使用ElementUI,官方提供的表格代码,样式错乱

在使用element编写前端代码是,引入element的css和js,使用官方提供的例子:<template>   <el-table :data=&...

vite+vue3项目中js方法调用

这这里一创建一个axios接口demo为例:首先安装axios,打开官方GitHub:https://github.com/axios/axios或者访问中文网站:https://www.axios-...

Vue3 Pinia持久化存储

一、Pinia持久化存储二、使用步骤1.安装插件代码如下(示例):npm i pinia-plugin-persist --save2.store/index.js代码如...

直接在浏览器中使用 vue3+element-plus中icons的方法

首先引入文件,如果用cdn的方式:<script src="//unpkg.com/@element-plus/icons-vue"></script&...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。