Comments (8)
@denvey 最近一两周内
from gaea-editor.
定义触发时机
首先在注册按钮组件时,定义它的支持的事件:
class Props {
public editSetting = {
key: 'my-button',
name: 'Button',
editors: [
// ..省略
],
events: [
{
text: 'OnClick',
field: 'onClick'
}
]
};
}
上面通过 events
注册了一个 OnClick
事件,事件的触发时机是 Button 组件的 onClick
回调触发时,而按钮实现 onClick 一般都是点击后触发,所以这个事件的触发时机就是点击按钮的时候触发。
下一步就是触发效果了,触发效果现在不能拓展,我最近会增加一个链接跳转的方式,这样只要组件注册了触发时机,就可以选择跳转到某个 url 了。
from gaea-editor.
主要是触发效果不知道怎么写,不了解内部事件机制的原理,有点无从下手,好比说我怎么跳转到内部其他页面去,点按钮打开模态框等等交互,最近也在看源码,但事件那部分还没弄懂,希望大神点拨点拨
from gaea-editor.
事件这块还在完善中,Modal 联动功能现在还不支持,具体效果完成后交互方式应该是这样:https://tb1.bdstatic.com/next-designer/event-emit.mp4
from gaea-editor.
OK 谢谢解答
from gaea-editor.
什么时候会更新到github上,期待ing
from gaea-editor.
貌似事件这块现在也没有完成,发现 event emitter 没有对外暴露,也没有提供注册内部event的方法,而且在新的page里面没有store管理的状态,我理解的Gaea editor应该基于事件流,通过上面的方法修改组件的状态,通过自定义的函数和服务器交互,然后再走 redux 那一套把数据绑到 view 上,完成整个逻辑的渲染。
前几天试了试clone 的代码,今天有看,如果有不对的地方,或者已经完成,还请指正
from gaea-editor.
@ascoders 事件机制我看现在的代码还是没有实现视频上的功能
from gaea-editor.
Related Issues (20)
- 克隆项目 npm run start 报错 HOT 2
- Uncaught ReferenceError: Save is not defined HOT 2
- preComponents有什么作用呢? HOT 3
- src/components/box-editor/src/box-editor/box-editor.component.tsx报错 HOT 1
- npm run docs 后浏览器提示https不安全 HOT 1
- Local development run,got a mistake HOT 1
- 给组件设置margin后,hover框偏移
- [教程-图文] 关于在Window里面使用WSL(Liunx子系统)来开发gaea-editor HOT 2
- [BUG] 当属性过多的时候,无法点击到对应的添加事件的按钮 HOT 1
- window安装了包之后,启动 HOT 3
- npm run docs运行不起来 HOT 2
- 引入Editor报错,Xe.create is not a function HOT 5
- 如何初始化编辑器布局? HOT 2
- 代码没法运行 , 但是不知道什么报错 HOT 3
- 请问 container 组件的 Grow参数是什么用的 ? HOT 1
- 钉钉二维码过期 HOT 1
- npm run start 报错
- 有没有用 JavaScript 或 vue 写的类似可视化搭建库
- 源码代码找半天
- 请问如何获取editor component onchange event?
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 gaea-editor.