fix: cannot read properties of undefined (reading 'offsetWidthi')

This commit is contained in:
landaiqing
2024-04-27 01:17:51 +08:00
parent 21e475db41
commit ded7ef012a
7 changed files with 1160 additions and 52 deletions

View File

@@ -14,6 +14,7 @@
"@ant-design/pro-components": "^2.7.0",
"@ant-design/use-emotion-css": "^1.0.4",
"@types/crypto-js": "^4.2.2",
"@vitejs/plugin-legacy": "^5.3.2",
"antd": "^5.16.1",
"axios": "^1.6.8",
"crypto-js": "^4.2.0",

1184
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,14 @@
import React from 'react'
const FooterComponent: React.FC = () => {
return (
<div style={{ textAlign: 'center', color: 'black' }}>
<div
style={{
textAlign: 'center',
color: 'black',
bottom: 0,
position: 'absolute',
width: '100%',
}}>
schisandra ©{new Date().getFullYear()} Created by schisandra
</div>
)

View File

@@ -17,7 +17,7 @@ const HomeIndex: React.FC = () => {
r: -8,
h: 160,
w: (el: any) => {
return Math.max(320, el.parentNode.offsetWidthi * 0.55)
return Math.max(320, el.parentNode.offsetWidth * 0.55)
},
},
@@ -47,7 +47,7 @@ const HomeIndex: React.FC = () => {
{
x: () => {
return Math.max(260, window.innerWidth * 0.45) * 1
return Math.max(260, window.innerWidth * 0.45)
},
y: -30,
r: -5,

View File

@@ -43,8 +43,8 @@ h1,p{
border-radius: 10px;
width: 100vw;
height: 100vh;
max-width: 99vw;
max-height: 93vh;
max-width: 98vw;
max-height: 92vh;
background: linear-gradient(180deg, #e0e9fd 0%, #e9ecf1 90%);
box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.4);
display: flex;

View File

@@ -10,7 +10,7 @@ const router = createBrowserRouter(routeConfig)
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<MobxProvider {...RootStore}>
<RouterProvider router={router} />
<RouterProvider router={router} />
</MobxProvider>
</React.StrictMode>
</React.StrictMode>,
)

View File

@@ -7,13 +7,19 @@ import * as path from 'path'
import imagemin from 'unplugin-imagemin/vite'
import viteCompression from 'vite-plugin-compression'
import { createHtmlPlugin } from 'vite-plugin-html'
import legacy from '@vitejs/plugin-legacy'
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-expect-error
//配置参数
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, process.cwd())
return {
plugins: [
react(),
legacy({
targets: ['defaults', 'ie >= 11', 'chrome 52'],
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
}),
// 修改 icons 相关配置
createSvgIconsPlugin({
// 指定需要缓存的图标文件夹