vue拖拽样式记录

拖拽通用样式记录

html 复制代码
   <draggable
      :list="fields"
      :animation="300"
      :delay="10"
      :force-fallback="true"
      drag-class="dragClass"
      fallback-class="fallbackClass"
      chosen-class="chosenClass"
      ghost-class="ghostClass"
      class="flex flex-1 w-full"
    ></draggable>
css 复制代码
<style scoped>
.drag-icon,
.delete-icon {
  cursor: pointer;
  width: 16px;
  height: 16px;
  background-repeat: no-repeat;
  background-position: center;
}

.drag-icon {
  background-image: url('./images/drag-icon.png');
  background-size: 100% 100%;
}

.delete-icon {
  background-image: url('./images/close.png');
  background-size: 100% 100%;
}

/* 拖动排序样式 */
.dragClass {
  opacity: 1;
}

.fallbackClass {
  opacity: 1;
}

.chosenClass {
  opacity: 0.96 !important;
}

.ghostClass {
  opacity: 0.7 !important;
}
</style>
相关推荐
写bug的可宋4 分钟前
【Electron】解决Electron使用阿里iconfont不生效问题(react+vite)
javascript·react.js·electron
小二·1 小时前
Python Web 开发进阶实战:无障碍深度集成 —— 构建真正包容的 Flask + Vue 应用
前端·python·flask
niucloud-admin9 小时前
web 端前端
前端
摘星编程12 小时前
React Native for OpenHarmony 实战:Linking 链接处理详解
javascript·react native·react.js
胖者是谁12 小时前
EasyPlayerPro的使用方法
前端·javascript·css
EndingCoder12 小时前
索引类型和 keyof 操作符
linux·运维·前端·javascript·ubuntu·typescript
liux352812 小时前
Web集群管理实战指南:从架构到运维
运维·前端·架构
沛沛老爹12 小时前
Web转AI架构篇 Agent Skills vs MCP:工具箱与标准接口的本质区别
java·开发语言·前端·人工智能·架构·企业开发
摘星编程13 小时前
React Native for OpenHarmony 实战:ImageBackground 背景图片详解
javascript·react native·react.js
小光学长13 小时前
基于Web的长江游轮公共服务系统j225o57w(程序+源码+数据库+调试部署+开发环境)带论文文档1万字以上,文末可获取,系统界面在最后面。
前端·数据库