Commit 74459aff authored by 蒋佳奇's avatar 蒋佳奇

feat: tailwindcss兼容antd

parent 7af2c21d
import { Suspense } from 'react'
import { StyleProvider } from '@ant-design/cssinjs'
import routes from '~react-pages'
import { ConfigProvider } from 'antd'
import Layouts from './layouts'
const App: React.FC = () => {
return (
<Suspense fallback={<Spin fullscreen />}>
<Layouts>{useRoutes(routes)}</Layouts>
<StyleProvider layer>
<ConfigProvider>
<Layouts>{useRoutes(routes)}</Layouts>
</ConfigProvider>
</StyleProvider>
</Suspense>
)
}
......
@import "tailwindcss"
\ No newline at end of file
@import "tailwindcss/utilities";
@import "tailwindcss/theme";
/* @import "tailwindcss/preflight"; */
\ No newline at end of file
......@@ -21,15 +21,16 @@ const BasicLayout: React.FC<React.PropsWithChildren> = ({ children }) => {
const navigate = useNavigate()
return (
<Layout style={{ minHeight: '100vh' }}>
<Sider breakpoint='lg'>
<div className='demo-logo-vertical' />
<Menu theme='dark' mode='vertical' items={menuItems} onSelect={({ key }) => navigate(key)} />
</Sider>
<Layout className='min-h-screen text-9xl'>
<Header className='p-0' />
<Layout>
<Header style={{ padding: 0, background: colorBgContainer }} />
<Content style={{ margin: '24px 16px 0' }}>
<div style={{ padding: 24, background: colorBgContainer }}>{children}</div>
<Sider breakpoint='lg'>
<Menu theme='dark' mode='vertical' items={menuItems} onSelect={({ key }) => navigate(key)} />
</Sider>
<Content className='mt-6 mx-4'>
<div className='p-6' style={{ background: colorBgContainer }}>
{children}
</div>
</Content>
</Layout>
</Layout>
......
......@@ -3,11 +3,12 @@ import { createRoot } from 'react-dom/client'
import { HashRouter } from 'react-router-dom'
import App from './App'
import './index.css'
import '@ant-design/v5-patch-for-react-19'
import 'antd/dist/reset.css'
import './index.css'
const app = createRoot(document.getElementById('root')!)
app.render(
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment