{"id":2995,"date":"2024-11-10T15:51:47","date_gmt":"2024-11-10T07:51:47","guid":{"rendered":"https:\/\/fwq.ai\/blog\/2995\/"},"modified":"2024-11-10T15:51:47","modified_gmt":"2024-11-10T07:51:47","slug":"vue-%e9%a1%b9%e7%9b%ae%e4%b8%ad%ef%bc%8ciconfont-%e6%96%87%e4%bb%b6%e5%a4%b9%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\/2995\/","title":{"rendered":"Vue \u9879\u76ee\u4e2d\uff0ciconfont \u6587\u4ef6\u5939\u5e94\u8be5\u653e\u5728\u54ea\u91cc\uff1f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/001\/246\/273\/173096173611300.jpg\" class=\"aligncenter\" title=\"Vue \u9879\u76ee\u4e2d\uff0ciconfont \u6587\u4ef6\u5939\u5e94\u8be5\u653e\u5728\u54ea\u91cc\uff1f\u63d2\u56fe\" alt=\"Vue \u9879\u76ee\u4e2d\uff0ciconfont \u6587\u4ef6\u5939\u5e94\u8be5\u653e\u5728\u54ea\u91cc\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>iconfont \u6587\u4ef6\u5939\u5728  \u9879\u76ee\u4e2d\u7684\u6700\u4f73\u4f4d\u7f6e<\/strong><\/p>\n<p>\u5728 Vue \u9879\u76ee\u4e2d\u4f7f\u7528 iconfont \u65f6\uff0c\u5c06 iconfont \u6587\u4ef6\u5939\u653e\u7f6e\u5728\u4f55\u5904\u53ef\u80fd\u4f1a\u5f15\u53d1\u4e00\u4e9b\u7591\u95ee\u3002<\/p>\n<p><strong>\u653e\u7f6e\u4f4d\u7f6e<\/strong><\/p>\n<p>iconfont \u6587\u4ef6\u5939\u53ef\u4ee5\u653e\u5728 assets \u6216 static \u5305\u4e0b\u3002\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5939\u90fd\u7528\u4f5c\u9759\u6001\u8d44\u6e90\u7684\u5b58\u50a8\u4f4d\u7f6e\uff0c\u56e0\u6b64 iconfont \u6587\u4ef6\u5c06\u88ab\u89c6\u4e3a\u9759\u6001\u8d44\u6e90\u5e76\u5728\u9879\u76ee\u5b89\u88c5\u671f\u95f4\u88ab\u5f15\u7528\u3002<\/p>\n<p><strong>\u9519\u8bef\u548c\u89e3\u51b3\u65b9\u6848<\/strong><\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<p>\u5982\u679c\u4f60\u5c06 iconfont \u6587\u4ef6\u5939\u653e\u7f6e\u5728 assets \u6587\u4ef6\u5939\u4e0b\u540e\u51fa\u73b0\u9519\u8bef\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u8be5\u6587\u4ef6\u5939\u4e2d\u7684\u67d0\u4e2a\u6587\u4ef6\u4e0e Vue CLI \u51b2\u7a81\u3002\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u8bf7\u5c1d\u8bd5\u5c06 iconfont \u6587\u4ef6\u5939\u79fb\u52a8\u5230 static \u6587\u4ef6\u5939\u4e2d\u3002<\/p>\n<p><strong>\u5f15\u7528\u4f4d\u7f6e<\/strong><\/p>\n<p>\u8981\u5f15\u7528 iconfont \u6587\u4ef6\uff0c\u53ef\u4ee5\u5728 index.html \u6587\u4ef6\u6216 mn.js \u6587\u4ef6\u4e2d\u5305\u542b iconfont. \u6587\u4ef6\u3002\u4e24\u79cd\u65b9\u6cd5\u90fd\u53ef\u4ee5\u5b9e\u73b0\uff0c\u4f46\u6709\u4e0d\u540c\u7684\u4f18\u70b9\uff1a<\/p>\n<ul>\n<li> <strong>index.html\uff1a<\/strong>\u5728 index.html \u4e2d\u5f15\u7528 iconfont.css\uff0c\u786e\u4fdd\u5728\u9875\u9762\u52a0\u8f7d\u4e4b\u524d\u5c31\u52a0\u8f7d\u4e86\u56fe\u6807\u3002\u8fd9\u5bf9\u4e8e\u9700\u8981\u56fe\u6807\u7acb\u5373\u663e\u793a\u7684\u9875\u9762\u975e\u5e38\u6709\u7528\u3002<\/li>\n<li> <strong>main.js\uff1a<\/strong>\u5728 main.js \u4e2d\u5f15\u7528 iconfont.css\uff0c\u53ef\u4ee5\u8ba9\u56fe\u6807\u7684\u5f15\u7528\u66f4\u52a0\u96c6\u4e2d\u3002\u8fd9\u5bf9\u4e8e\u5177\u6709\u5927\u91cf\u7ec4\u4ef6\u7684\u9879\u76ee\u5f88\u6709\u7528\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u5728\u6bcf\u4e2a\u7ec4\u4ef6\u4e2d\u5f15\u7528\u540c\u6837\u7684 CSS \u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p>\u603b\u4f53\u800c\u8a00\uff0c\u5728 main.js \u4e2d\u5f15\u7528 iconfont.css \u662f\u5927\u591a\u6570\u9879\u76ee\u7684\u66f4\u4f18\u89e3\uff0c\u56e0\u4e3a\u5b83\u63d0\u4f9b\u4e86\u66f4\u9ad8\u7684\u4ee3\u7801\u7b80\u6d01\u6027\u548c\u53ef\u79fb\u690d\u6027\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662fVue \u9879\u76ee\u4e2d\uff0ciconfont \u6587\u4ef6\u5939\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\u5728 \u9879\u76ee\u4e2d\u7684\u6700\u4f73\u4f4d\u7f6e \u5728 Vue \u9879\u76ee\u4e2d\u4f7f\u7528 iconfont \u65f6\uff0c\u5c06 iconfont \u6587\u4ef6\u5939\u653e\u7f6e\u5728\u4f55\u5904\u53ef\u80fd\u4f1a\u5f15\u53d1\u4e00\u4e9b\u7591\u95ee\u3002 \u653e\u7f6e\u4f4d\u7f6e iconfont \u6587\u4ef6\u5939\u53ef\u4ee5\u653e\u5728 assets \u6216 static \u5305\u4e0b\u3002\u8fd9\u4e24\u4e2a\u6587\u4ef6\u5939\u90fd\u7528\u4f5c\u9759\u6001\u8d44\u6e90\u7684\u5b58\u50a8\u4f4d\u7f6e\uff0c\u56e0\u6b64 iconfont \u6587\u4ef6\u5c06\u88ab\u89c6\u4e3a\u9759\u6001\u8d44\u6e90\u5e76\u5728\u9879\u76ee\u5b89\u88c5\u671f\u95f4\u88ab\u5f15\u7528\u3002 \u9519\u8bef\u548c\u89e3\u51b3\u65b9\u6848 \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b \u5982\u679c\u4f60\u5c06 iconfont \u6587\u4ef6\u5939\u653e\u7f6e\u5728 assets \u6587\u4ef6\u5939\u4e0b\u540e\u51fa\u73b0\u9519\u8bef\uff0c\u53ef\u80fd\u662f\u56e0\u4e3a\u8be5\u6587\u4ef6\u5939\u4e2d\u7684\u67d0\u4e2a\u6587\u4ef6\u4e0e Vue CLI \u51b2\u7a81\u3002\u8981\u89e3\u51b3\u6b64\u95ee\u9898\uff0c\u8bf7\u5c1d\u8bd5\u5c06 iconfont \u6587\u4ef6\u5939\u79fb\u52a8\u5230 static \u6587\u4ef6\u5939\u4e2d\u3002 \u5f15\u7528\u4f4d\u7f6e \u8981\u5f15\u7528 iconfont \u6587\u4ef6\uff0c\u53ef\u4ee5\u5728 index.html \u6587\u4ef6\u6216 mn.js \u6587\u4ef6\u4e2d\u5305\u542b iconfont. \u6587\u4ef6\u3002\u4e24\u79cd\u65b9\u6cd5\u90fd\u53ef\u4ee5\u5b9e\u73b0\uff0c\u4f46\u6709\u4e0d\u540c\u7684\u4f18\u70b9\uff1a index.html\uff1a\u5728 index.html \u4e2d\u5f15\u7528 iconfont.css\uff0c\u786e\u4fdd\u5728\u9875\u9762\u52a0\u8f7d\u4e4b\u524d\u5c31\u52a0\u8f7d\u4e86\u56fe\u6807\u3002\u8fd9\u5bf9\u4e8e\u9700\u8981\u56fe\u6807\u7acb\u5373\u663e\u793a\u7684\u9875\u9762\u975e\u5e38\u6709\u7528\u3002 main.js\uff1a\u5728 main.js \u4e2d\u5f15\u7528 iconfont.css\uff0c\u53ef\u4ee5\u8ba9\u56fe\u6807\u7684\u5f15\u7528\u66f4\u52a0\u96c6\u4e2d\u3002\u8fd9\u5bf9\u4e8e\u5177\u6709\u5927\u91cf\u7ec4\u4ef6\u7684\u9879\u76ee\u5f88\u6709\u7528\uff0c\u56e0\u4e3a\u53ef\u4ee5\u907f\u514d\u5728\u6bcf\u4e2a\u7ec4\u4ef6\u4e2d\u5f15\u7528\u540c\u6837\u7684 CSS \u6587\u4ef6\u3002 \u603b\u4f53\u800c\u8a00\uff0c\u5728 main.js [&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-2995","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2995","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=2995"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/2995\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=2995"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=2995"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=2995"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}