1.2.4 • Published 1 year ago
@cniot/pageflow v1.2.4
pageflow
GS
- page
import React from 'react';
import { PageFlowApp, GriffenService, Desktop } from '@cniot/PageFlow";
const service = new GriffenService({
domain: "https://test-edge.loginx.cainiao.com",
appId: "10446@pageflow.prog",
groupId: "bdecff5ce70e42df",
credentials: "omit",
});
const app = new PageFlowApp({
service,
notFoundPagePath: "/system/404",
showErrorPagePath: "/system/toast",
});
app.registerPage("/firstPage", function(props){
const {data, onNext} = props;
// data = {text:"hello world"}
return <div>
hello first page
<button onClick={onNext.bind(server)} >下一步</button>
</div>;
});
ReactDOM.render(<Desktop app={app} server={service} ></Desktop>, document.getElementById('root'));
- gs
var nextData = pageFlow.firstPage({
text:"hello world"
});
纯前端
- 业务流程 flow.js
import {UserInterface} from '@cniot/pageflow';
export const appId = "hello";
export function onStart(){
const code = await UI.router("/pages/scanDesk", {title:"请扫描"});
console.log("code", code); // 123
}
const UI = new UserInterface({
appId
});
- 页面
import React from 'react';
import { PageFlowApp, WebService, Desktop } from '@cniot/PageFlow";
import {appId, onStart} from './flow.js';
const service = new WebService({
appId,
onStart
});
const app = new PageFlowApp({
service,
notFoundPagePath: "/system/404",
showErrorPagePath: "/system/toast",
});
app.registerPage("/pages/scanDesk", function(props){
const {data, onNext} = props;
// data = {title:"请扫描"}
return <div>
hello first page
<button onClick={()=> onNext(123)} >下一步</button>
</div>;
});
ReactDOM.render(<Desktop app={app} server={service} ></Desktop>, document.getElementById('root'));
1.2.4
1 year ago
1.2.3
2 years ago
1.2.2
2 years ago
1.2.0
2 years ago
1.2.1
2 years ago
1.1.1
2 years ago
1.1.0
2 years ago
1.1.2
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
2 years ago
1.0.4
2 years ago
1.0.3
2 years ago
0.3.6
2 years ago
0.3.5
2 years ago
0.3.4
2 years ago
0.3.3
2 years ago
0.4.1
2 years ago
0.4.0
2 years ago
0.3.0
2 years ago
0.3.2
2 years ago
0.3.1
2 years ago
0.2.5
2 years ago
0.2.4
2 years ago
0.2.3
3 years ago
0.2.2
3 years ago
0.2.1
3 years ago
0.2.0
3 years ago
0.1.6
3 years ago
0.1.5
3 years ago
0.1.2
3 years ago
0.1.4
3 years ago
0.1.3
3 years ago
0.1.1
3 years ago
0.0.21
3 years ago
0.1.0
3 years ago
0.0.20
3 years ago
0.0.18
3 years ago
0.0.19
3 years ago
0.0.16
3 years ago
0.0.17
3 years ago
0.0.13
3 years ago
0.0.14
3 years ago
0.0.15
3 years ago
0.0.12
3 years ago
0.0.11
3 years ago
0.0.10
3 years ago
0.0.9
3 years ago
0.0.8
3 years ago
0.0.7
3 years ago
0.0.6
3 years ago
0.0.5
3 years ago
0.0.3
3 years ago
0.0.4
3 years ago
0.0.2
3 years ago
0.0.1
3 years ago