{"id":2759,"date":"2024-11-10T16:10:40","date_gmt":"2024-11-10T08:10:40","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2759\/"},"modified":"2024-11-10T16:10:40","modified_gmt":"2024-11-10T08:10:40","slug":"%e4%bd%bf%e7%94%a8-iconfont-%e6%97%b6%ef%bc%8c%e5%9b%be%e6%a0%87%e6%96%87%e4%bb%b6%e5%ba%94%e8%af%a5%e6%94%be%e5%9c%a8%e5%93%aa%e9%87%8c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/2759\/","title":{"rendered":"\u4f7f\u7528 Iconfont \u65f6\uff0c\u56fe\u6807\u6587\u4ef6\u5e94\u8be5\u653e\u5728\u54ea\u91cc\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173087259662916.jpg\" class=\"aligncenter\" title=\"\u4f7f\u7528 Iconfont \u65f6\uff0c\u56fe\u6807\u6587\u4ef6\u5e94\u8be5\u653e\u5728\u54ea\u91cc\uff1f\u63d2\u56fe\" alt=\"\u4f7f\u7528 Iconfont \u65f6\uff0c\u56fe\u6807\u6587\u4ef6\u5e94\u8be5\u653e\u5728\u54ea\u91cc\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>iconfont \u6587\u4ef6\u5939\u7684\u6700\u4f73\u653e\u7f6e\u4f4d\u7f6e<\/strong><\/p>\n<p>\u5728\u4f7f\u7528 iconfont \u65f6\uff0c\u56fe\u6807\u6587\u4ef6\u5e94\u8be5\u653e\u7f6e\u7684\u4f4d\u7f6e\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u56de\u7b54\u6b64\u95ee\u9898\uff1a<\/p>\n<p><strong>\u6587\u4ef6\u653e\u7f6e\u4f4d\u7f6e<\/strong><\/p>\n<p>\u5c06 iconfont \u6587\u4ef6\u5939\u653e\u7f6e\u5728 <strong>assets<\/strong> \u6216 <strong>static<\/strong> \u76ee\u5f55\u4e0b\u90fd\u53ef\u4ee5\u3002\u8fd9\u4e24\u4e2a\u76ee\u5f55\u90fd\u7528\u4e8e\u5b58\u50a8\u4e0d\u4f1a\u88ab JavaScript \u4ee3\u7801\u5904\u7406\u7684\u9759\u6001\u8d44\u6e90\u3002\u5728\u5b89\u88c5\u671f\u95f4\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5c06\u88ab\u5f15\u7528\u3002<\/p>\n<p><strong>Assets \u6587\u4ef6\u5939\u4e2d\u7684\u9519\u8bef<\/strong><\/p>\n<p>\u5982\u679c\u60a8\u5c06 iconfont \u6587\u4ef6\u5939\u653e\u5728 <strong>assets<\/strong> \u76ee\u5f55\u4e0b\u5e76\u8fd0\u884c npm run\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u9519\u8bef\u3002\u8fd9\u662f\u56e0\u4e3a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8d44\u4ea7\u6587\u4ef6\u5939\u4e0d\u88ab webpack \u5904\u7406\u3002\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u9700\u8981\u5728 webpack.config.js \u6587\u4ef6\u4e2d\u914d\u7f6e webpack \u4ee5\u5904\u7406\u8d44\u4ea7\u6587\u4ef6\u5939\u3002<\/p>\n<p><strong>\u5f15\u7528\u65b9\u5f0f<\/strong><\/p>\n<p>\u53ef\u4ee5\u4ece <strong>index.html<\/strong> \u6216 <strong>mn.js<\/strong> \u5f15\u7528 iconfont. \u6587\u4ef6\u3002\u4e24\u79cd\u65b9\u6cd5\u90fd\u53ef\u4ee5\uff0c\u52a0\u8f7d\u987a\u5e8f\u548c\u7f16\u7801\u4e60\u60ef\u5c06\u51b3\u5b9a\u5c06\u6587\u4ef6\u653e\u7f6e\u5728\u4f55\u5904\u3002<\/p>\n<p><strong>\u63a8\u8350\u5f15\u7528\u65b9\u5f0f<\/strong><\/p>\n<p>\u5728\u6d41\u884c\u7684 Vue \u9879\u76ee\u4e2d\uff0c<strong>90%<\/strong> \u7684\u9879\u76ee\u9009\u62e9\u5728 <strong>main.js<\/strong> \u4e2d\u5f15\u7528\u516c\u5171\u8d44\u6e90\u3002\u8fd9\u662f\u56e0\u4e3a Vue \u7ec4\u4ef6\u901a\u5e38\u5728\u7ec4\u4ef6\u5185\u90e8\u5b8c\u6210\u9875\u9762\u6e32\u67d3\uff0c\u51cf\u5c11\u7ec4\u4ef6\u4e2d\u516c\u5171\u8d44\u6e90\u7684\u5f15\u7528\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7b80\u6d01\u6027\u548c\u53ef\u79fb\u690d\u6027\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u4f7f\u7528 Iconfont \u65f6\uff0c\u56fe\u6807\u6587\u4ef6\u5e94\u8be5\u653e\u5728\u54ea\u91cc\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>iconfont \u6587\u4ef6\u5939\u7684\u6700\u4f73\u653e\u7f6e\u4f4d\u7f6e \u5728\u4f7f\u7528 iconfont \u65f6\uff0c\u56fe\u6807\u6587\u4ef6\u5e94\u8be5\u653e\u7f6e\u7684\u4f4d\u7f6e\u662f\u4e00\u4e2a\u5e38\u89c1\u7684\u95ee\u9898\u3002\u4ee5\u4e0b\u662f\u5982\u4f55\u56de\u7b54\u6b64\u95ee\u9898\uff1a \u6587\u4ef6\u653e\u7f6e\u4f4d\u7f6e \u5c06 iconfont \u6587\u4ef6\u5939\u653e\u7f6e\u5728 assets \u6216 static \u76ee\u5f55\u4e0b\u90fd\u53ef\u4ee5\u3002\u8fd9\u4e24\u4e2a\u76ee\u5f55\u90fd\u7528\u4e8e\u5b58\u50a8\u4e0d\u4f1a\u88ab JavaScript \u4ee3\u7801\u5904\u7406\u7684\u9759\u6001\u8d44\u6e90\u3002\u5728\u5b89\u88c5\u671f\u95f4\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5c06\u88ab\u5f15\u7528\u3002 Assets \u6587\u4ef6\u5939\u4e2d\u7684\u9519\u8bef \u5982\u679c\u60a8\u5c06 iconfont \u6587\u4ef6\u5939\u653e\u5728 assets \u76ee\u5f55\u4e0b\u5e76\u8fd0\u884c npm run\uff0c\u53ef\u80fd\u4f1a\u9047\u5230\u9519\u8bef\u3002\u8fd9\u662f\u56e0\u4e3a\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8d44\u4ea7\u6587\u4ef6\u5939\u4e0d\u88ab webpack \u5904\u7406\u3002\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u9700\u8981\u5728 webpack.config.js \u6587\u4ef6\u4e2d\u914d\u7f6e webpack \u4ee5\u5904\u7406\u8d44\u4ea7\u6587\u4ef6\u5939\u3002 \u5f15\u7528\u65b9\u5f0f \u53ef\u4ee5\u4ece index.html \u6216 mn.js \u5f15\u7528 iconfont. \u6587\u4ef6\u3002\u4e24\u79cd\u65b9\u6cd5\u90fd\u53ef\u4ee5\uff0c\u52a0\u8f7d\u987a\u5e8f\u548c\u7f16\u7801\u4e60\u60ef\u5c06\u51b3\u5b9a\u5c06\u6587\u4ef6\u653e\u7f6e\u5728\u4f55\u5904\u3002 \u63a8\u8350\u5f15\u7528\u65b9\u5f0f \u5728\u6d41\u884c\u7684 Vue \u9879\u76ee\u4e2d\uff0c90% \u7684\u9879\u76ee\u9009\u62e9\u5728 main.js \u4e2d\u5f15\u7528\u516c\u5171\u8d44\u6e90\u3002\u8fd9\u662f\u56e0\u4e3a Vue \u7ec4\u4ef6\u901a\u5e38\u5728\u7ec4\u4ef6\u5185\u90e8\u5b8c\u6210\u9875\u9762\u6e32\u67d3\uff0c\u51cf\u5c11\u7ec4\u4ef6\u4e2d\u516c\u5171\u8d44\u6e90\u7684\u5f15\u7528\u53ef\u4ee5\u63d0\u9ad8\u4ee3\u7801\u7b80\u6d01\u6027\u548c\u53ef\u79fb\u690d\u6027\u3002 \u4ee5\u4e0a\u5c31\u662f\u4f7f\u7528 Iconfont \u65f6\uff0c\u56fe\u6807\u6587\u4ef6\u5e94\u8be5\u653e\u5728\u54ea\u91cc\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},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16],"tags":[],"class_list":["post-2759","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2759","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=2759"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2759\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2759"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2759"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2759"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}