From 1e4b1c34527c0e01339862dd9f6291ca333ea466 Mon Sep 17 00:00:00 2001 From: gaoyunqi Date: Tue, 11 Jun 2024 16:05:28 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E4=BF=AE=E5=A4=8D=E4=B8=80=E5=A4=84?= =?UTF-8?q?=E8=A1=A8=E5=8D=95=E4=BA=8C=E5=BC=80=E7=9A=84=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/表单二开/1_拆分表单.md | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/docs/表单二开/1_拆分表单.md b/docs/表单二开/1_拆分表单.md index 8c07cf8..0b96b9e 100644 --- a/docs/表单二开/1_拆分表单.md +++ b/docs/表单二开/1_拆分表单.md @@ -69,15 +69,20 @@ export default { mixins: [SimpleFormSetup], setup(props, ctx) { const ret = SimpleForm.setup(props, ctx); - const schemaMap = {}; - ret.getSchemas._value.forEach((schema) => { - schemaMap[schema.key] = schema; - }); return { - schemaMap, ...ret }; }, + computed: { + // 这里需要增加一个计算属性 否则流程关联时字段读写状态会失效 + schemaMap() { + const schemaMap = {}; + this.getSchemas.forEach((schema) => { + schemaMap[schema.key] = schema; + }); + return schemaMap; + } + }, methods: { getIfShow2: function (key) { return this.getIfShow(this.schemaMap[key], this.formModel[this.schemaMap[key].field]);