当前位置: 首页 > news >正文

温州微网站品牌注册号

温州微网站,品牌注册号,wordpress图片专辑,平台软件前言 因为公司业务开发需要拖拽功能。 ps#xff1a;该功能只能针对高度一致的#xff0c;如果高度不一致需要另外二开 演示 开始 templateview styleheight: 100%;movable-area :style{width: 100%, height: allHeight px}该功能只能针对高度一致的如果高度不一致需要另外二开 演示 开始 templateview styleheight: 100%;movable-area :style{width: 100%, height: allHeight px}movable-viewv-for(item, index) in list:keyitem.id:x0:yitem.y:style{height: itemHeight px, width: 100%,}directionalltouchstarthandleDragStart(index)changehandleMoving(index, $event)touchendhandleDragEndclassmovable-view!-- 这里可以放置步骤的详细内容 --view stylebackground-color: aqua; padding: 20rpx 0;{{ item.desc }}/view/movable-view/movable-area/view /templatescript export default {data() {return {list: [],cloneList: [],activeIndex: -1, // 选中oldIndex: -1,moveToIndex: -1, // 移动allHeight: 300,itemHeight: 50};},created() {for(let i 0; i 12; i ) {let info {id: i,desc: 测试 i}this.list.push(info)}this.allHeight 12 * this.itemHeightthis.initList(this.list)},methods: {deepCopy(source) {return JSON.parse(JSON.stringify(source));},initList(list[]){const newList this.deepCopy(list);this.list newList.map((item, index) {return {...item,y: index * this.itemHeight,key: Math.random() index};});//拷贝一份初始list值this.cloneList this.deepCopy(this.list);},// 拖拽开始handleDragStart(index) {this.activeIndex index;this.oldIndex index;},handleMoving(index, e){if (e.detail.source ! touch) return;const { x, y } e.detail;const currentY Math.floor((y this.itemHeight / 2) / this.itemHeight);this.moveToIndex Math.min(currentY, this.list.length - 1);//更新移动后的位置if (this.oldIndex ! this.moveToIndex this.oldIndex ! -1 this.moveToIndex ! -1) {const newList this.deepCopy(this.cloneList);//交换位置newList.splice(this.moveToIndex, 0, ...newList.splice(this.activeIndex, 1));this.list.forEach((item, index) {if (index ! this.activeIndex) {const itemIndex newList.findIndex(val val.id item.id);item.y itemIndex*this.itemHeight}});this.oldIndex this.moveToIndex;}},handleDragEnd(e) {if (this.moveToIndex ! -1 this.activeIndex ! -1 this.moveToIndex ! this.activeIndex) {this.cloneList.splice(this.moveToIndex, 0, ...this.cloneList.splice(this.activeIndex, 1));}// 重新排序下更新后的位置。this.initList(this.cloneList);this.activeIndex -1;this.oldIndex -1;this.moveToIndex -1;},}, }; /scriptstyle .movable-area {}.movable-view {} /style
http://www.dnsts.com.cn/news/134472.html

相关文章:

  • 自贡普通网站建设费用郴州招聘网直招最新招聘
  • 上海医疗网站备案knowall wordpress
  • 网站建设规划书主题网站建设与维护典型案例
  • dede 网站地图样式做网站排名需要多少钱
  • 蒲城做网站网站seo检测
  • 网站做优化效果怎样怎样做当地网站推广
  • 江苏网站建设价格低360网站关键词排名优化
  • 哪个网站推广好中国最新的国内军事新闻
  • 做外贸一般去什么网站找客户西数网站管理助手 伪静态
  • 大理建网站视频网站推广怎么做
  • 企业网站如何制作空间平面的网页设计素材
  • 设计的网站源代码怎么做哪些客户需要做网站
  • 网站制作公司员工郑州网站优化渠道
  • 金华公司网站建设网络公司排名
  • 有什么做ppt参考的网站wordpress 福利
  • 工信部网站备案查询步骤html教程 it教程网
  • 改网站字体颜色代码小程序开发平台哪家产品好
  • 网站的建设步骤包括常州企业免费建站
  • 建网站程序怎么办学校网站网页制作
  • 南昌公路建设有限公司网站wordpress模版手机
  • 在线做汉字头像的网站开发软件的工具
  • 那些做环保网站的好处网站建设好与管理在哪就业
  • 在线免费网站模板网站 备案号查询
  • 网站有哪些风格亚马逊做deal的网站
  • 网站建设怎么配置伪静态文件最酷炫的wordpress the7
  • 如何自建网站 优帮云网站备案时间也太慢了
  • 湖南专业外贸建站公司南宁网站制作开发公司
  • 免费网站推广网站不用下载hishop网站搬家
  • 怎么做网站美工做管理培训的网站有什么
  • php构建网站如何开始南京营销网站开发制作报价