- 前端配置化Schema
- Serverless = FaaS + BaaS
编程思想:在每一层处理每一层的事情。
// Home
const handleSaveBtnClick = () => {
const { children } = areaListRef.current;
const schema = { name: 'Page', attributes: {}, children }
window.localStorage.schema = JSON.stringify(schema);
}
// areaList
const AreaList = (props, ref) => {
const [ children, setChildren ] = useState(props.children);
const handleAddBtnClick = () => {
}
const handleDeleteBtnClick = (index) => {
}
useImperativeHandle(ref, () => {
return { children };
})
return (
<div></div>
)
}
export default forwardRef(AreaList);
useImperativeHandle()