Comments (9)
@Yeung2017 使用 withPropsAPI
包装组件,具体使用参照 这里
from ggeditor.
@gaoli 谢谢,这个方法很方便.是我自己没有仔细看文档.
from ggeditor.
看了withPropsAPI 文档,还是不知道怎么调用save,可以把代码贴出来看下吗?
from ggeditor.
import { withPropsAPI } from 'gg-editor';
class Component extends React.Component {
componentDidMount() {
const { propsAPI } = this.props;
const { save } = propsAPI;
console.log(save());
}
}
export default withPropsAPI(Component);
from ggeditor.
import React from 'react';
import { Flow, withPropsAPI } from '@src';
import styles from './index.scss';
import { Button } from '../../../../node_modules/antd';
class FlowWithPropsAPI extends React.Component {
constructor(props){
super(props);
}
saveFlow = () =>{
console.log(this.props.propsAPI.save());
}
render() {
return(
<div>
<Flow
className={styles.flow}
style={{height: 600}}
/>
<Button onClick={this.saveFlow}>保存流程图</Button>
</div>
);
}
}
from ggeditor.
懂了
@gaoli 谢谢。
from ggeditor.
from ggeditor.
@yinbanghui 请提供下在线的 DEMO,谢谢:)
from ggeditor.
同样按照楼上的withPropsAPI 的方式未能获取到,this.props.propsAPI 为一个空对象{},暂时用的楼主的方法 ref graph.save解决
from ggeditor.
Related Issues (20)
- 3.x 如何阻止双击FlowNode可以编辑节点名 HOT 1
- Mind删除节点会调用什么接口
- 这个文档后续能继续更新吗,现在文档不全很多功能没法使用 HOT 2
- 哪位大牛告知下使用文档在哪里?找不到..... HOT 1
- 如何更新自定义节点的局部样式呢?graph.updateItem报错不是方法 HOT 4
- Mind Editor Drag and Drop nodes
- 通过ENV变量控制埋点开关 HOT 1
- 麻烦看下https://www.yuque.com/ggeditor/api/flow 提供的文档404 HOT 1
- editor区域大小发生变化时视口并未随之更新 HOT 2
- 两个锚点只能是直线链接
- ERROR when using with Next.js. GGEditor is no longer maintained?
- http://ggeditor.com/docs/api/command.zh-CN.html 这个文档打不开了吗? HOT 1
- 您好,Flow组件如何设置只读,Flow上的顶点和线只读不能拖动和修改,这个可以设置吗? HOT 1
- koni支持自动拓扑
- koni如何提供点击展开功能
- 是否提供流程图导出功能?以及导出后的二次编辑功能呢? HOT 1
- When redo command is trigger no edges are restored
- 拖进一个新节点时, 默认的虚线框能修改吗
- 还有人维护吗 HOT 1
- 理性讨论:创建这个项目的人是不是有病? HOT 3
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 ggeditor.