Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
406 views
in Technique[技术] by (71.8m points)

react实现H5在线编辑器

clipboard.png

对于上图所示的编辑器,大牛分析一下组件分布。
我的思路是

clipboard.png

最外层包含左中右组件,然后其他再继续往下嵌套。但是这样不知道什么原因很多操作都会出现卡顿,比如中间元素的拖拽,会出现很明显的卡顿。

大牛来分析分析!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

拖拽事件是怎么处理的呢?是改变绝对定位的top,left还是改变transform:translate?如果用的是这两种方式,建议给容器添加transition,使定位相关的属性发生变化时可以平滑过渡,减少卡顿感。希望可以帮到你。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...