ant-design/d050a2d2-async.44087b1d.js

1 line
10 KiB
JavaScript
Raw Normal View History

(("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd=("undefined"!=typeof globalThis?globalThis:self).makoChunk_antd||[]).push([["d050a2d2"],{d050a2d2:function(n,e,t){"use strict";t.d(e,"__esModule",{value:!0}),t.d(e,"texts",{enumerable:!0,get:function(){return a;}}),t("0d87afb3");let a=[{value:"\u670D\u52A1\u7AEF\u6E32\u67D3\u6837\u5F0F\u6709\u4E24\u79CD\u65B9\u6848\uFF0C\u5B83\u4EEC\u5404\u6709\u4F18\u7F3A\u70B9\uFF1A",paraId:0},{value:"\u5185\u8054\u6837\u5F0F",paraId:1},{value:"\uFF1A\u5728\u6E32\u67D3\u65F6\u65E0\u9700\u989D\u5916\u8BF7\u6C42\u6837\u5F0F\u6587\u4EF6\uFF0C\u597D\u5904\u662F\u51CF\u5C11\u989D\u5916\u7684\u7F51\u7EDC\u8BF7\u6C42\uFF0C\u7F3A\u70B9\u5219\u662F\u4F1A\u4F7F\u5F97 HTML \u4F53\u79EF\u589E\u5927\uFF0C\u5F71\u54CD\u9996\u5C4F\u6E32\u67D3\u901F\u5EA6\uFF0C\u76F8\u5173\u8BA8\u8BBA\u53C2\u8003\uFF1A",paraId:1},{value:"#39891",paraId:1},{value:"\u6574\u4F53\u5BFC\u51FA",paraId:1},{value:"\uFF1A\u63D0\u524D\u70D8\u7119 antd \u7EC4\u4EF6\u6837\u5F0F\u4E3A css \u6587\u4EF6\uFF0C\u5728\u9875\u9762\u4E2D\u65F6\u5F15\u5165\u3002\u597D\u5904\u662F\u6253\u5F00\u4EFB\u610F\u9875\u9762\u65F6\u5982\u4F20\u7EDF css \u65B9\u6848\u4E00\u6837\u90FD\u4F1A\u590D\u7528\u540C\u4E00\u5957 css \u6587\u4EF6\u4EE5\u547D\u4E2D\u7F13\u5B58\uFF0C\u7F3A\u70B9\u662F\u5982\u679C\u9875\u9762\u4E2D\u5B58\u5728\u591A\u4E3B\u9898\uFF0C\u5219\u9700\u8981\u989D\u5916\u8FDB\u884C\u70D8\u7119",paraId:1},{value:"\u4F7F\u7528 ",paraId:2,tocIndex:0},{value:"@ant-design/cssinjs",paraId:2,tocIndex:0},{value:" \u5C06\u6240\u9700\u6837\u5F0F\u62BD\u79BB\uFF1A",paraId:2,tocIndex:0},{value:"import React from 'react';\nimport { createCache, extractStyle, StyleProvider } from '@ant-design/cssinjs';\nimport type Entity from '@ant-design/cssinjs/es/Cache';\nimport { renderToString } from 'react-dom/server';\n\nconst App = () => {\n // SSR Render\n const cache = React.useMemo<Entity>(() => createCache(), []);\n const html = renderToString(\n <StyleProvider cache={cache}>\n <MyApp />\n </StyleProvider>,\n );\n\n // Grab style from cache\n const styleText = extractStyle(cache);\n\n // Mix with style\n return `\n <!DOCTYPE html>\n <html>\n <head>\n ${styleText}\n </head>\n <body>\n <div id=\"root\">${html}</div>\n </body>\n </html>\n `;\n};\n\nexport default App;\n",paraId:3,tocIndex:0},{value:"\u5982\u679C\u4F60\u60F3\u8981\u5C06\u6837\u5F0F\u6587\u4EF6\u62BD\u79BB\u5230 css \u6587\u4EF6\u4E2D\uFF0C\u53EF\u4EE5\u5C1D\u8BD5\u4F7F\u7528\u4EE5\u4E0B\u65B9\u6848\uFF1A",paraId:4,tocIndex:1},{value:"\u5B89\u88C5\u4F9D\u8D56",paraId:5,tocIndex:1},{value:"npm install ts-node tslib cross-env --save-dev\n",paraId:6,tocIndex:1},{value:"\u65B0\u589E ",paraId:7,tocIndex:1},{value:"tsconfig.node.json",paraId:7,tocIndex:1},{value:" \u6587\u4EF6",paraId:7,tocIndex:1},{value:'{\n "compilerOptions": {\n "strictNullChecks": true,\n "module": "NodeNext",\n "jsx": "react",\n "esModuleInterop": true\n },\n "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]\n}\n',paraId:8,tocIndex:1},{value:"\u65B0\u589E ",paraId:9,tocIndex:1},{value:"scripts/genAntdCss.tsx",paraId:9,tocIndex:1},{value:" \u6587\u4EF6",paraId:9,tocIndex:1},{value:"// scripts/genAntdCss.tsx\nimport fs from 'fs';\nimport { extractStyle } from '@ant-design/static-style-extract';\n\nconst outputPath = './public/antd.min.css';\n\nconst css = extractStyle();\n\nfs.writeFileSync(outputPath, css);\n",paraId:10,tocIndex:1},{value:"\u82E5\u4F60\u60F3\u4F7F\u7528\u6DF7\u5408\u4E3B\u9898\u6216\u81EA\u5B9A\u4E49\u4E3B\u9898\uFF0C\u53EF\u91C7\u7528\u4EE5\u4E0B\u811A\u672C\uFF1A",paraId:11,tocIndex:1},{value:"import fs from 'fs';\nimport React from 'react';\nimport { extractStyle } from '@ant-design/static-style-extract';\nimport { ConfigProvider } from 'antd';\n\nconst outputPath = './public/antd.min.css';\n\nconst testGreenColor = '#008000';\nconst testRedColor = '#ff0000';\n\nconst css = extractStyle((node) => (\n <>\n <ConfigProvider\n theme={{\n token: {\n colorBgBase: testGreenColor,\n },\n