更新 snapshot & form 获取父级数据逻辑调整

This commit is contained in:
2betop 2021-06-21 10:21:55 +08:00
parent 56fdddb129
commit 72d747e74f
6 changed files with 184 additions and 205 deletions

View File

@ -37,9 +37,6 @@ exports[`Renderer:hbox 1`] = `
>
<div
class="a-Grid-col--md3 bg-white"
>
<div
class="a-Wrapper"
>
<div
class="a-Form-item a-Form-item--normal"
@ -63,7 +60,6 @@ exports[`Renderer:hbox 1`] = `
</div>
</div>
</div>
</div>
<div
class="a-Grid-col--md9"
>

View File

@ -33,13 +33,10 @@ exports[`Renderer:hbox 1`] = `
data-role="form-item"
>
<div
class="a-Hbox"
class="a-Hbox a-Hbox--xs"
>
<div
class="a-Hbox-col w-sm"
>
<div
class="a-Wrapper"
>
<div
class="a-Form-item a-Form-item--normal"
@ -63,7 +60,6 @@ exports[`Renderer:hbox 1`] = `
</div>
</div>
</div>
</div>
<div
class="a-Hbox-col"
>

View File

@ -33,13 +33,10 @@ exports[`Renderer:panel 1`] = `
data-role="form-item"
>
<div
class="a-Hbox"
class="a-Hbox a-Hbox--xs"
>
<div
class="a-Hbox-col"
>
<div
class="a-Wrapper"
>
<div
class="a-Form-item a-Form-item--normal"
@ -136,12 +133,8 @@ exports[`Renderer:panel 1`] = `
</div>
</div>
</div>
</div>
<div
class="a-Hbox-col"
>
<div
class="a-Wrapper"
>
<div
class="a-Form-item a-Form-item--normal"
@ -254,7 +247,6 @@ exports[`Renderer:panel 1`] = `
</div>
</div>
</div>
</div>
<input
style="display: none;"
type="submit"

View File

@ -3,7 +3,7 @@
exports[`Renderer:hbox 1`] = `
<div>
<div
class="a-Hbox"
class="a-Hbox a-Hbox--xs"
>
<div
class="a-Hbox-col w-xs"

View File

@ -184,12 +184,7 @@ export function wrapControl<
// 同步 value
model.changeTmpValue(
propValue ??
store?.getValueByName(
model.name,
canAccessSuperData !== false
) ??
value
propValue ?? store?.getValueByName(model.name) ?? value
);
// 如果没有初始值,通过 onChange 设置过去

View File

@ -25,7 +25,7 @@ export const iRendererStore = StoreNode.named('iRendererStore')
drawerData: types.optional(types.frozen(), undefined)
})
.views(self => ({
getValueByName(name: string, canAccessSuper: boolean = false) {
getValueByName(name: string, canAccessSuper: boolean = true) {
return getVariable(self.data, name, canAccessSuper);
},