leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

视图功能的一个建议

Open mozbia opened this issue 3 months ago • 2 comments

App 的 move 配置了 scroll = 'limit' ,当元素比较小时,拖动的时候会跳来跳去。 不知道大佬以后会不会支持: 在 limit 的效果下,较小内容直接居中在视口。 如果会的话我就不自己弄了😄😄

https://github.com/user-attachments/assets/af39cc9f-412b-496d-a2fd-829caa24792e

配置代码如下: ` const leafer = new App({ view: window, move: { drag: 'auto', scroll: 'limit', },

tree: { type: 'design' },
editor: {
  select: 'tap',
},

}) `

mozbia avatar Sep 19 '25 08:09 mozbia

后面可以优化一下😂,目前可以通过zoom方法实现,或者限制滚动的轴limit-y,再居中。

leaferjs avatar Sep 19 '25 09:09 leaferjs

好的好的😂,我自己弄了一个,大概是这样的,居不居中好像也行

https://github.com/user-attachments/assets/01f14c48-49ca-458c-bb3c-f376cd39153b

mozbia avatar Sep 19 '25 12:09 mozbia