Comments (9)
怎么没法加标签?
必须要是contributor吗?
from frontend-interview.
1没做过
2拖拽:鼠标在工具上mousedown的时候让新工具的坐标=鼠标的坐标-(鼠标的坐标-新工具的坐标)。
鼠标mouseup的时候取消拖动。
连线:这个不知道是什么。。
3把每个工具都写成对象。
4 比如快捷键?收集数据最经常用到的工具图标来设置快键键。
比如模板?如上 为了懒才用工具的嘛。
from frontend-interview.
@kevinwulong 第二点2,拖拽包括鼠标三个事件mousedown——mousemove——mouseup,另外你说的坐标计算也不对。mousedown
时记下当前坐标,假设设置标志位flag=true
,mousemove
时,如果flag===true
,则获取鼠标位置,计算并动态更改工具坐标,这样工具位置就动态改变了,mouseup
标记flag=false,此时工具位置是最终位置。
有类似开源项目代码,可以参考源码
https://github.com/fex-team/kityminder
https://github.com/jgraph/draw.io
from frontend-interview.
@giscafer 谢谢回复!我去刷刷看你提供的源码。
from frontend-interview.
@ningxzx 你需要加什么标签,我帮你加吧
from frontend-interview.
@FrankFang 确实简洁了不少!我觉得“组件”相关的标签都行
from frontend-interview.
用canvas画吧
from frontend-interview.
from frontend-interview.
1.没做过。思路:按JSON格式存储,自标题往下嵌套,备注描述均为json中的字段。
from frontend-interview.
Related Issues (20)
- JS 作用域链相关问题 HOT 5
- JS 作用域、原型链 HOT 3
- 重复声明两个函数会怎样? HOT 4
- ES5中“严格模式”与“非严格模式”的区别? HOT 3
- ajax请求序列化问题 HOT 5
- 循环/闭包/setTimeout/Promise 综合 HOT 1
- 服务端如何区分不同的用户 HOT 4
- 使用ES6实现该方法 HOT 13
- dom操作相关 HOT 7
- 什么是FP?与OOP的关系?
- 为何会出现浏览器兼容性问题?如何解决? HOT 2
- 前端性能优化 HOT 2
- JavaScript 分组 HOT 13
- 自适应和响应式有什么区别和联系
- 如何实现深拷贝? HOT 1
- 两个js数组相关题目 HOT 7
- 面试题汇总
- jrg interview questions HOT 7
- 实现一个深拷贝 HOT 8
- 宏任务微任务题 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from frontend-interview.