Skip to content

Commit

Permalink
fix(form): fix jsonCode bgColor no work in dart mode
Browse files Browse the repository at this point in the history
close #6629
  • Loading branch information
chenshuai2144 committed Jul 17, 2023
1 parent 89e1fb4 commit 03927db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/field/src/components/Code/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
import type { ProFieldFC } from '../../index';

// 兼容代码-----------
import { proTheme } from '@ant-design/pro-provider';
import 'antd/lib/input/style';
//----------------------

Expand Down Expand Up @@ -33,6 +34,7 @@ const FieldCode: ProFieldFC<{
ref,
) => {
const code = languageFormat(text, language);
const { token } = proTheme.useToken();
if (mode === 'read') {
const dom = (
<pre
Expand All @@ -43,7 +45,9 @@ const FieldCode: ProFieldFC<{
overflow: 'auto',
fontSize: '85%',
lineHeight: 1.45,
backgroundColor: '#f6f8fa',
color: token.colorTextSecondary,
fontFamily: token.fontFamilyCode,
backgroundColor: 'rgba(150, 150, 150, 0.1)',
borderRadius: 3,
width: 'min-content',
...fieldProps.style,
Expand Down

0 comments on commit 03927db

Please sign in to comment.