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>
相关推荐
comerzhang65514 分钟前
Web 性能的架构边界:跨线程信令通道的确定性分析
javascript·webassembly
Hooray17 分钟前
为了在 Vue 项目里用上想要的 React 组件,我写了这个 skill
前端·ai编程
咸鱼翻身了么19 分钟前
模仿ai数据流 开箱即用
前端
风花雪月_19 分钟前
🔥IntersectionObserver:前端性能优化的“隐形监工”
前端
Bigger19 分钟前
告别 AI 塑料感:我是如何用 frontend-design skill 重塑项目官网的
前端·ai编程·trae
发际线向北19 分钟前
0x02 Android DI 框架解析之Hilt
前端
Ruihong20 分钟前
Vue v-bind 转 React:VuReact 怎么处理?
vue.js·react.js·面试
zhensherlock33 分钟前
Protocol Launcher 系列:Overcast 一键订阅播客
前端·javascript·typescript·node.js·自动化·github·js
liangdabiao1 小时前
开源AI拼豆大升级 - 一键部署cloudflare page - 全免费 web和小程序
前端·人工智能·小程序
SuperHeroWu71 小时前
【鸿蒙基础入门】概念理解和学习方法论说明
前端·学习·华为·开源·harmonyos·鸿蒙·移动端