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
The text was updated successfully, but these errors were encountered:
1、resource里面的fields是关于字段的定义,可以使用ams.resource定义来公用资源
2、block里面的fields是当前区块对于字段的定义,当区块里面指定resource时,优先级 bolck.field > resource.field
3、区块的vue实例里面fields会混合resource.fields和当前block.fields配置生成一份用于交互渲染的fields,放于实例的fields里面,所以需要动态的修改field的属性实现一些交互行为需要用this.fields.xxx或者ams.$block.blockName.fields.xxx来修改
如图:
Sorry, something went wrong.
ams.block('form', { resource: { api: { ... }, fields: { switch: { type: 'switch', label: '切换' }, input: { type: 'text', label: '文字' } } }, ctx: 'view', type: 'form', fields: { input: { label: '文字2' } }, actions: { fieldChange({ name, value, path}){ if (name === 'switch') { this.fields.input.props.disable = !!value } } } })
No branches or pull requests
The text was updated successfully, but these errors were encountered: