1 Star 0 Fork 1

赵权 / wechat_multi-line_column_movable

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

微信小程序使用 movable-view 组件实现多行多列拖动功能

实现原理:因为 movable-view 是靠 x,y 属性定位显示,拖动放手后,把拖动项的 x,y 坐标用放手时坐标替换,然后给数组按照 x,y 坐标排序,排序后再用循环给每个项坐标新的定位值

效果图

输入图片说明

相关代码仅在 index.js,index.wxml,index.css

待优化

  • 拖动定位坐标,目前是每个元素的左上角,应改为中心点

大幅修改

元素拖动替换,修改为数组下标替换法,放到分支dragchanegindex

  • 右拖要拖到替换项右侧,左拖要拖到替换项左侧
MIT License Copyright (c) 2021 赵权 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

小程序实现多行多列拖动 展开 收起
JavaScript
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
1
https://gitee.com/zhaoquan/wechat_multi-line_column_movable.git
git@gitee.com:zhaoquan/wechat_multi-line_column_movable.git
zhaoquan
wechat_multi-line_column_movable
wechat_multi-line_column_movable
master

搜索帮助