From e95027d3ad72c84d5ca1cff8ac1a9532fe844aa5 Mon Sep 17 00:00:00 2001 From: Uyarn Date: Tue, 24 Dec 2024 17:04:59 +0800 Subject: [PATCH] chore: fix box demo --- site/src/components/stackblitz/content.js | 8 ++++++-- site/src/components/stackblitz/index.jsx | 6 +++--- src/form/_example/form-field-linkage.tsx | 4 +--- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/site/src/components/stackblitz/content.js b/site/src/components/stackblitz/content.js index cf85fb9986..21ebbe5e95 100644 --- a/site/src/components/stackblitz/content.js +++ b/site/src/components/stackblitz/content.js @@ -1,11 +1,12 @@ import orgPkg from '../../../../package.json'; export const htmlContent = ` -
+
+ `; export const mainJsContent = ` - import React from 'react'; + import React, { StrictMode } from 'react'; import { createRoot } from 'react-dom/client'; import Demo from './demo'; @@ -105,10 +106,13 @@ export const packageJSONContent = JSON.stringify( 'react-dom': orgPkg.devDependencies['react-dom'], 'tdesign-react': orgPkg.version, 'tdesign-icons-react': orgPkg.dependencies['tdesign-icons-react'], + '@types/react': orgPkg.devDependencies['@types/react'], + '@types/react-dom': orgPkg.devDependencies['@types/react-dom'], }, devDependencies: { vite: orgPkg.devDependencies.vite, '@vitejs/plugin-react': orgPkg.devDependencies['@vitejs/plugin-react'], + typescript: orgPkg.devDependencies.typescript, }, }, null, diff --git a/site/src/components/stackblitz/index.jsx b/site/src/components/stackblitz/index.jsx index 13f7ddd724..2a4c118fcb 100644 --- a/site/src/components/stackblitz/index.jsx +++ b/site/src/components/stackblitz/index.jsx @@ -25,7 +25,6 @@ export default function Stackblitz(props) { setIsTypeScriptDemo(isTypeScriptDemo); setTimeout(() => { - console.log(formRef.current, 111); formRef.current.submit(); }); } @@ -35,7 +34,7 @@ export default function Stackblitz(props) {
@@ -48,11 +47,12 @@ export default function Stackblitz(props) { )} - + +
diff --git a/src/form/_example/form-field-linkage.tsx b/src/form/_example/form-field-linkage.tsx index 69f7790e74..5eee192845 100644 --- a/src/form/_example/form-field-linkage.tsx +++ b/src/form/_example/form-field-linkage.tsx @@ -1,7 +1,5 @@ import React from 'react'; -import Form from '../Form'; -import Radio from '../../radio'; -import Button from '../../button'; +import { Form, Radio, Button } from 'tdesign-react'; const { FormItem } = Form;