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

俄罗斯网站制作优化的含义

俄罗斯网站制作,优化的含义,深圳做网站要多少钱,定州网站建设公司前言 因为公司业务开发需要拖拽功能。 ps&#xff1a;该功能只能针对高度一致的&#xff0c;如果高度不一致需要另外二开 演示 开始 <template><view style"height: 100%;"><movable-area :style"{width: 100%, height: allHeight px}"…

前言

因为公司业务开发需要拖拽功能。

ps:该功能只能针对高度一致的,如果高度不一致需要另外二开

演示

开始

<template><view style="height: 100%;"><movable-area :style="{'width': '100%', 'height': allHeight + 'px'}"><movable-viewv-for="(item, index) in list":key="item.id":x="0":y="item.y":style="{'height': itemHeight + 'px', 'width': '100%',}"direction="all"@touchstart="handleDragStart(index)"@change="handleMoving(index, $event)"@touchend="handleDragEnd"class="movable-view"><!-- 这里可以放置步骤的详细内容 --><view style="background-color: aqua; padding: 20rpx 0;">{{ item.desc }}</view></movable-view></movable-area></view>
</template><script>
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;},},
};
</script><style>
.movable-area {}.movable-view {}
</style>

http://www.mnyf.cn/news/51252.html

相关文章:

  • 动态网站开发的技术开发小程序
  • 网站建设公司 中企动力公司媒体公关公司
  • 云教育科技网站建设重庆seo论
  • 做网站一天网页设计与制作作业成品
  • 做外卖有哪些网站seo建站工具
  • 做外链网站有哪些今日新闻最新消息
  • 青岛app网站开发东莞新闻头条新闻
  • 网站模板做网站直播营销策划方案范文
  • 接收外国电视卫星天线兰州seo网站建设
  • 网络公司网站官网长沙网站定制公司
  • 承接网站建设广告语百度健康人工客服电话24小时
  • 国外企业网站模板霸屏推广
  • 汕头网站制作哪里好怎么做网络营销平台
  • 做网站交易平台今日国际重大新闻
  • 开发平台官网优搜云seo
  • 怎样快速仿做网站关键词热度分析
  • 永康市建设局网站交换链接是什么
  • 训做网站的心得体会范文网络推广和网络营销的区别
  • 网站两列导航百度网页网址
  • 网站建设一般多少钱外贸推广
  • 沈阳企业关键词优化seo运营推广
  • asp做网站计数器企业产品网络推广
  • 江河建设集团有限公司网站郑州seo代理外包
  • 动漫设计课程广告投放优化师
  • 邵阳找工作网站关键词批量调词软件
  • 模板搭建网站整合营销传播的方法包括
  • 丽水市城市建设投资有限责任公司网站免费seo公司
  • 网站经营百中搜优化
  • 手机浏览器下载大全免费下载长沙官网网站推广优化
  • 青海网站制作的公司最近有哪些新闻