当前位置: 首页 > 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.ds6.com.cn/news/114166.html

相关文章:

  • 动态网站开发的技术seo搜索优化公司排名
  • 豫港大厦 做网站杭州seo网
  • 公司网站后台怎么上传图片域名估价
  • 外贸三种语言网站建设上海网络营销
  • 可以做宣传的网站有哪些seo教程搜索引擎优化
  • 广州17网站一起做网店关键词挖掘工具有哪些
  • 网站开发报价单站长工具服务器查询
  • 策划方案免费的网站网站服务器ip地址查询
  • 自己网站如何做关键词排名互联网广告公司
  • 中国自适应网站建设长尾关键词挖掘站长工具
  • html5移动网站开发重庆seo网络优化咨询热线
  • 1688电脑网页版代做seo排名
  • 太原制作公司网站怎么做链接推广产品
  • 网站后台管理系统设计怎么引流推广
  • 建筑设计单位福州seo网站推广优化
  • 网站模板被抄袭怎么办关键词搜索数据
  • 做公司网站,哪个程序用的多淘客推广怎么做
  • 郴州网站优化搜索引擎链接
  • 郑州做网站的外包公司百度企业官网
  • 杭州网站关键词百度指数怎么提升
  • 学做网站的笔记本网站建设企业咨询
  • 融资网站建设重点四川seo多少钱
  • 学编程有什么好处抖音seo排名优化软件
  • 网站栏目优化真正免费建站网站
  • 长江工程建设局网站必应站长平台
  • 淄博哪家网络公司做网站好百度搜索引擎投放
  • 安卓上怎么做单机网站自制网页
  • 网站建设目标怎样开自己的网站
  • 网站设计专家短视频营销方式有哪些
  • 页面设计模板网站如何让网站被百度收录