ascoders / gaea-editor

Design websites in your browser. A smart web editor!

Home Page:https://gaeajs.github.io/gaea-site/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

预设组件怎么使用

huangguozhen opened this issue · comments

感谢作者,这是一个很好的项目。看到了它,我就被他吸引了。读了源代码,其中有一个关于预设组件的设定,没理解怎么使用。麻烦作者举个例子说明一下。

比如注册了一个 Button,gaeaKey 叫做 my-button,但我想让这个按钮在菜单被拖拽时就拥有某种预设属性,甚至给这个 Button 不同的 props,在菜单上叫做不同的名字(small-button、large-button)方便用户使用。(从产品角度来说,趋势图和柱状图是不同的组件,但对开发者来说,可能都是由 echarts 组件做到,这时候就需要用 preComponents 将其拆分为不同组件显示在拖拽菜单)

用法见最新版 Demo:https://github.com/ascoders/gaea-editor/blob/master/docs/basic.tsx#L16

@ascoders 了解,谢谢。