From 6a3998a03bd2f5770caa827cbfaabbd7171ab6de Mon Sep 17 00:00:00 2001 From: lmaomaoz <727559597@qq.com> Date: Fri, 29 Mar 2024 15:45:44 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8DTabs=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E6=96=87=E6=A1=A3=E5=92=8CEditor=E4=B8=ADmountOnEnter=E9=BB=98?= =?UTF-8?q?=E8=AE=A4=E5=80=BC=E6=94=B9=E4=B8=BAtrue=E5=92=8Crenderer?= =?UTF-8?q?=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4=20(#9920)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: jinye --- docs/zh-CN/components/tabs.md | 2 +- packages/amis-editor/src/plugin/Tabs.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/zh-CN/components/tabs.md b/docs/zh-CN/components/tabs.md index 8fd0e2d91..c7c6cbe6d 100755 --- a/docs/zh-CN/components/tabs.md +++ b/docs/zh-CN/components/tabs.md @@ -857,7 +857,7 @@ order: 68 | tabs[x].tip | `string` | | `3.2.0及以上版本支持` Tab 提示,当开启 `showTip` 时生效,作为 Tab 在 hover 时的提示显示,可不配置,如不设置,`tabs[x].title` 作为提示显示 | | tabs[x].closable | `boolean` | false | 是否支持删除,优先级高于组件的 `closable` | | tabs[x].disabled | `boolean` | false | 是否禁用 | -| mountOnEnter | `boolean` | false | 只有在点中 tab 的时候才渲染 | +| mountOnEnter | `boolean` | true | 只有在点中 tab 的时候才渲染 | | unmountOnExit | `boolean` | false | 切换 tab 的时候销毁 | | addable | `boolean` | false | 是否支持新增 | | addBtnText | `string` | 增加 | 新增按钮文案 | diff --git a/packages/amis-editor/src/plugin/Tabs.tsx b/packages/amis-editor/src/plugin/Tabs.tsx index be11ec0c0..03a1e8492 100644 --- a/packages/amis-editor/src/plugin/Tabs.tsx +++ b/packages/amis-editor/src/plugin/Tabs.tsx @@ -48,7 +48,8 @@ export class TabsPlugin extends BasePlugin { title: '选项卡2', body: [] } - ] + ], + mountOnEnter: true }; previewSchema = { ...this.scaffold