{"id":1915,"date":"2024-11-10T08:30:17","date_gmt":"2024-11-10T00:30:17","guid":{"rendered":"https:\/\/fwq.ai\/blog\/1915\/"},"modified":"2024-11-10T08:30:17","modified_gmt":"2024-11-10T00:30:17","slug":"react-%e5%92%8c-vite-%e4%b8%ad%e5%a6%82%e4%bd%95%e8%a7%a3%e5%86%b3-ant-design-css-%e7%b1%bb%e4%b8%8d%e8%87%aa%e5%8a%a8%e5%8a%a0%e8%bd%bd%e7%9a%84%e9%97%ae%e9%a2%98%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/1915\/","title":{"rendered":"React \u548c Vite \u4e2d\u5982\u4f55\u89e3\u51b3 Ant Design CSS \u7c7b\u4e0d\u81ea\u52a8\u52a0\u8f7d\u7684\u95ee\u9898\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173061487230270.jpg\" class=\"aligncenter\" title=\"React \u548c Vite \u4e2d\u5982\u4f55\u89e3\u51b3 Ant Design CSS \u7c7b\u4e0d\u81ea\u52a8\u52a0\u8f7d\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" alt=\"React \u548c Vite \u4e2d\u5982\u4f55\u89e3\u51b3 Ant Design CSS \u7c7b\u4e0d\u81ea\u52a8\u52a0\u8f7d\u7684\u95ee\u9898\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>react vs. vite\uff1a\u81ea\u52a8\u52a0\u8f7d  \u673a\u5236<\/strong><\/p>\n<p>\u5728\u5f15\u5165 css \u6587\u4ef6\u7684\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528 css \u7c7b\u4e0d\u4f1a\u81ea\u52a8\u52a0\u8f7d css \u6837\u5f0f\u3002\u7136\u800c\uff0c\u67d0\u4e9b\u5de5\u5177\u548c\u5e93\u53ef\u80fd\u4f1a\u63d0\u4f9b\u81ea\u52a8\u52a0\u8f7d\u529f\u80fd\u3002<\/p>\n<p><strong>ant design \u7684\u81ea\u52a8\u6837\u5f0f\u52a0\u8f7d<\/strong><\/p>\n<p>ant design \u662f\u4e00\u4e2a react \u7ec4\u4ef6\u5e93\uff0c\u5b83\u5141\u8bb8\u4f60\u5728\u4e0d\u5f15\u5165\u5355\u72ec css \u6587\u4ef6\u7684\u60c5\u51b5\u4e0b\u4f7f\u7528 css \u7c7b\u3002\u8fd9\u662f\u56e0\u4e3a ant design \u7ec4\u4ef6\u662f\u7528 jsx \u7f16\u5199\u7684\uff0cjsx \u53ef\u4ee5\u5305\u542b\u6837\u5f0f\u4fe1\u606f\u3002\u5f53\u8fd9\u4e9b\u7ec4\u4ef6\u88ab\u6e32\u67d3\u65f6\uff0cant design \u4f1a\u5c06\u6837\u5f0f\u81ea\u52a8\u6ce8\u5165\u5230 dom \u4e2d\u3002<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p><strong>\u9650\u5236\u81ea\u52a8\u52a0\u8f7d<\/strong><\/p>\n<p>\u5982\u679c\u4f60\u4e0d\u60f3\u4f7f\u7528\u81ea\u52a8\u52a0\u8f7d\u529f\u80fd\uff0c\u53ef\u4ee5\u5728 ant design \u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u7981\u7528\u5b83\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a<\/p>\n<ol>\n<li>\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e2d\u627e\u5230 tsconfig.json \u6587\u4ef6\u3002<\/li>\n<li>\u5728 jsconfig.json \u6587\u4ef6\u4e2d\uff0c\u5c06 jsx \u9009\u9879\u8bbe\u7f6e\u4e3a react\u3002<\/li>\n<\/ol>\n<pre>{\n  \"compilerOptions\": {\n    \/\/ ...\n    \"jsx\": \"react\"\n    \/\/ ...\n  }\n}<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/p>\n<p>\u901a\u8fc7\u6267\u884c\u6b64\u66f4\u6539\uff0cant design \u5c06\u4e0d\u518d\u81ea\u52a8\u52a0\u8f7d\u6837\u5f0f\uff0c\u5e76\u4e14\u4f60\u9700\u8981\u624b\u52a8\u5f15\u5165 css \u6587\u4ef6\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fReact \u548c Vite \u4e2d\u5982\u4f55\u89e3\u51b3 Ant Design CSS \u7c7b\u4e0d\u81ea\u52a8\u52a0\u8f7d\u7684\u95ee\u9898\uff1f\u7684\u8be6\u7ec6\u5185\u5bb9\uff0c\u66f4\u591a\u8bf7\u5173\u6ce8\u7c73\u4e91\u5176\u5b83\u76f8\u5173\u6587\u7ae0\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"<p>react vs. vite\uff1a\u81ea\u52a8\u52a0\u8f7d \u673a\u5236 \u5728\u5f15\u5165 css \u6587\u4ef6\u7684\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528 css \u7c7b\u4e0d\u4f1a\u81ea\u52a8\u52a0\u8f7d css \u6837\u5f0f\u3002\u7136\u800c\uff0c\u67d0\u4e9b\u5de5\u5177\u548c\u5e93\u53ef\u80fd\u4f1a\u63d0\u4f9b\u81ea\u52a8\u52a0\u8f7d\u529f\u80fd\u3002 ant design \u7684\u81ea\u52a8\u6837\u5f0f\u52a0\u8f7d ant design \u662f\u4e00\u4e2a react \u7ec4\u4ef6\u5e93\uff0c\u5b83\u5141\u8bb8\u4f60\u5728\u4e0d\u5f15\u5165\u5355\u72ec css \u6587\u4ef6\u7684\u60c5\u51b5\u4e0b\u4f7f\u7528 css \u7c7b\u3002\u8fd9\u662f\u56e0\u4e3a ant design \u7ec4\u4ef6\u662f\u7528 jsx \u7f16\u5199\u7684\uff0cjsx \u53ef\u4ee5\u5305\u542b\u6837\u5f0f\u4fe1\u606f\u3002\u5f53\u8fd9\u4e9b\u7ec4\u4ef6\u88ab\u6e32\u67d3\u65f6\uff0cant design \u4f1a\u5c06\u6837\u5f0f\u81ea\u52a8\u6ce8\u5165\u5230 dom \u4e2d\u3002 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u9650\u5236\u81ea\u52a8\u52a0\u8f7d \u5982\u679c\u4f60\u4e0d\u60f3\u4f7f\u7528\u81ea\u52a8\u52a0\u8f7d\u529f\u80fd\uff0c\u53ef\u4ee5\u5728 ant design \u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u7981\u7528\u5b83\u3002\u5177\u4f53\u6b65\u9aa4\u5982\u4e0b\uff1a \u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e2d\u627e\u5230 tsconfig.json \u6587\u4ef6\u3002 \u5728 jsconfig.json \u6587\u4ef6\u4e2d\uff0c\u5c06 jsx \u9009\u9879\u8bbe\u7f6e\u4e3a react\u3002 { &#8220;compilerOptions&#8221;: { \/\/ &#8230; &#8220;jsx&#8221;: &#8220;react&#8221; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-1915","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1915","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=1915"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/1915\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=1915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=1915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=1915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}