We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
目前的配置:
const config = { resources: { res1: { api: {} fields: {} }, res2: { api: {} fields: {} }, ... }, blocks: { block1: { type: 'form', resource: 'res1', blocks: { block1_1: { type: 'component', blocks: { ... } } } }, block2: { type: 'list', resource: 'res2', blocks: { block1_1: { type: 'component', blocks: { ... } } } } } }
还有个问题,像上面写配置的方式,无法实现block的复用(比如上面的block1_1),只能通过抽出来用变量保存,然后再复用。这样就离纯json配置的目标又远一步了。
AMS框架拿到用户配置时,会在内部做拉平处理。
解决方案:
新增resource类型,资源和区块声明级别拉平,增加支持通过base: 'blockname'来继承已有区块,增加布局描述字段
base: 'blockname'
尽量避免使用blocks来嵌套子区块(除非使用插槽)
const config = { res1: { type: 'resource', api: {}, fields: {} }, res2: { type: 'resource', api: {}, fields: {} }, block0: { type: 'component', ... }, block1_1: { base: 'block0', type: 'component', ... }, block1: { type: 'form', resource: 'res1', ... }, block2: { type: 'list', resource: 'res2', ... }, layout: [ // 布局结构描述 { block1: [ 'block1_1', 'block1_2' ] }, { block2: [ { 'block2_1': [ 'block2_1_1', 'block2_1_2' ] }, 'block2_2' ] } ] }
还需要解决的问题:
The text was updated successfully, but these errors were encountered:
No branches or pull requests
目前的配置:
AMS框架拿到用户配置时,会在内部做拉平处理。
解决方案:
还需要解决的问题:
The text was updated successfully, but these errors were encountered: