From cdfc418f3904b2aec7d54e9e86ceeb176dde6e99 Mon Sep 17 00:00:00 2001 From: chenos Date: Mon, 4 Apr 2022 09:37:00 +0800 Subject: [PATCH] feat: edit tooltip for the read pretty field --- .../antd/form-item/FormItem.tsx | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/packages/client/src/schema-component/antd/form-item/FormItem.tsx b/packages/client/src/schema-component/antd/form-item/FormItem.tsx index 7fe231e3c..98072c8ad 100644 --- a/packages/client/src/schema-component/antd/form-item/FormItem.tsx +++ b/packages/client/src/schema-component/antd/form-item/FormItem.tsx @@ -106,6 +106,37 @@ FormItem.Designer = () => { }} /> )} + {field.readPretty && ( + { + field.decoratorProps.tooltip = tooltip; + fieldSchema['x-decorator-props'] = fieldSchema['x-decorator-props'] || {}; + fieldSchema['x-decorator-props']['tooltip'] = tooltip; + dn.emit('patch', { + schema: { + 'x-uid': fieldSchema['x-uid'], + 'x-decorator-props': fieldSchema['x-decorator-props'], + }, + }); + dn.refresh(); + }} + /> + )} {!field.readPretty && (