1.0.0-alpha.16 • Published 4 years ago
@brickd/react v1.0.0-alpha.16
brick-design
拖拽画板
📦 Install
yarn add @brickd/react @brickd/react-web @brickd/render
OR
npm install @brickd/react @brickd/react-web @brickd/render
Usage
import {createElement} from 'react';
import {BrickDesign,BrickTree,BrickProvider,useSelector,createActions} from '@brickd/react';
import {BrickPreview} from '@brickd/react-web';
import BrickRender from '@brickd/render';
const plugins=[(vDom,componentSchema)=>vDom];
const customReducer=(state,action)=>{
const {type,payload}=action
switch (type){
case 'customReducer':
return {...state}
default:
return state
}
}
const App = () => {
const {pageConfig}=useSelector(['pageConfig'])
return(<BrickProvider initState={{}} customReducer={customReducer} config={{...}}>
<div onClick={()=>createActions({type:"customReducer",payload:{...}})}> 出发action</div>
<BrickPreview/>
<BrickDesign />
<BrickRender pageConfig={pageConfig} createElement={createElement} plugins={plugins}/>
<BrickTree/>
</BrickProvider>);
}
1.0.0-alpha.16
4 years ago
1.0.0-alpha.15
4 years ago
1.0.0-alpha.14
4 years ago
1.0.0-alpha.13
4 years ago