From 91ae780e4f2f6295883750d71dbc7197f78b484a Mon Sep 17 00:00:00 2001 From: chenos Date: Wed, 9 Mar 2022 22:18:52 +0800 Subject: [PATCH] feat(client): improve code --- .../src/schema-component/antd/form-item/FormItem.tsx | 2 -- .../client/src/schema-component/antd/input/ReadPretty.tsx | 8 +++++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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 5d5ba5cdd..9b3f35fa5 100644 --- a/packages/client/src/schema-component/antd/form-item/FormItem.tsx +++ b/packages/client/src/schema-component/antd/form-item/FormItem.tsx @@ -115,8 +115,6 @@ FormItem.Designer = () => { dn.emit('patch', { schema, }); - // dn.refresh(); - reset(); refresh(); }, }; diff --git a/packages/client/src/schema-component/antd/input/ReadPretty.tsx b/packages/client/src/schema-component/antd/input/ReadPretty.tsx index 3ccd356dc..cf3043101 100644 --- a/packages/client/src/schema-component/antd/input/ReadPretty.tsx +++ b/packages/client/src/schema-component/antd/input/ReadPretty.tsx @@ -2,6 +2,7 @@ import { usePrefixCls } from '@formily/antd/lib/__builtins__'; import { InputProps, TextAreaProps } from 'antd/lib/input'; import cls from 'classnames'; import React from 'react'; +import { useCompile } from '../..'; import { EllipsisWithTooltip } from './EllipsisWithTooltip'; type Composed = { @@ -14,11 +15,12 @@ export const ReadPretty: Composed = () => null; ReadPretty.Input = (props) => { const prefixCls = usePrefixCls('description-input', props); + const compile = useCompile(); return (
{props.addonBefore} {props.prefix} - {props.value} + {compile(props.value)} {props.suffix} {props.addonAfter}
@@ -26,13 +28,13 @@ ReadPretty.Input = (props) => { }; ReadPretty.TextArea = (props) => { - console.log('EllipsisWithTooltip', props.ellipsis); const prefixCls = usePrefixCls('description-textarea', props); + const compile = useCompile(); return (
{props.addonBefore} {props.prefix} - {props.value} + {compile(props.value)} {props.suffix} {props.addonAfter}