{"id":53246,"date":"2024-12-03T14:50:42","date_gmt":"2024-12-03T06:50:42","guid":{"rendered":"https:\/\/fwq.ai\/blog\/53246\/"},"modified":"2024-12-03T14:50:42","modified_gmt":"2024-12-03T06:50:42","slug":"vue3vite%e9%a1%b9%e7%9b%ae%e4%b8%ad%e5%a6%82%e4%bd%95%e7%94%a8svg%e5%ae%9e%e7%8e%b0%e5%8a%a8%e6%80%81%e6%b5%81%e7%a8%8b%e5%9b%be%e5%a4%a7%e5%b1%8f%e6%95%88%e6%9e%9c%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/53246\/","title":{"rendered":"Vue3+Vite\u9879\u76ee\u4e2d\u5982\u4f55\u7528SVG\u5b9e\u73b0\u52a8\u6001\u6d41\u7a0b\u56fe\u5927\u5c4f\u6548\u679c\uff1f"},"content":{"rendered":"<p><b><\/b>     <\/p>\n<h1>Vue3+Vite\u9879\u76ee\u4e2d\u5982\u4f55\u7528SVG\u5b9e\u73b0\u52a8\u6001\u6d41\u7a0b\u56fe\u5927\u5c4f\u6548\u679c\uff1f<\/h1>\n<p>\u7c73\u4e91\u4eca\u5929\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u300aVue3+Vite\u9879\u76ee\u4e2d\u5982\u4f55\u7528SVG\u5b9e\u73b0\u52a8\u6001\u6d41\u7a0b\u56fe\u5927\u5c4f\u6548\u679c\uff1f\u300b<\/span>\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u8bf7\u7ee7\u7eed\u770b\u4e0b\u53bb\u5427\uff01\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\"><\/span>\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u662f\u6b63\u5728\u5b66\u4e60<span style=\"color: #FF6600;, Helvetica, Arial, sans-serif;font-size: 14px;background-color: #FFFFFF\">\u6587\u7ae0<\/span>\u6216\u8005\u5df2\u7ecf\u662f\u5927\u4f6c\u7ea7\u522b\u4e86\uff0c\u90fd\u975e\u5e38\u6b22\u8fce\u4e5f\u5e0c\u671b\u5927\u5bb6\u90fd\u80fd\u7ed9\u6211\u5efa\u8bae\u8bc4\u8bba\u54c8~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u5927\u5bb6\uff01<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.17golang.com\/uploads\/20241128\/1732776169674810e9c0b99.jpg\" class=\"aligncenter\" title=\"Vue3+Vite\u9879\u76ee\u4e2d\u5982\u4f55\u7528SVG\u5b9e\u73b0\u52a8\u6001\u6d41\u7a0b\u56fe\u5927\u5c4f\u6548\u679c\uff1f\u63d2\u56fe\" alt=\"Vue3+Vite\u9879\u76ee\u4e2d\u5982\u4f55\u7528SVG\u5b9e\u73b0\u52a8\u6001\u6d41\u7a0b\u56fe\u5927\u5c4f\u6548\u679c\uff1f\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5b9e\u73b0\u6d41\u7a0b\u56fe\u5927\u5c4f\u7684\u65b9\u6848<\/strong><\/p>\n<p>\u5728 vue3 + vite \u7684\u9879\u76ee\u4e2d\uff0c\u9700\u8981\u5b9e\u73b0\u4e00\u4e2a\u6d41\u7a0b\u56fe\u548c\u5927\u5c4f\u6548\u679c\u3002\u6d41\u7a0b\u56fe\u4e2d\u5404\u6d41\u7a0b\u4e4b\u95f4\u9700\u8981\u6709\u52a8\u6001\u6d41\u5411\u3002\u5982\u4f55\u5b9e\u73b0\u8fd9\u4e2a\u6548\u679c\u5462\uff1f<\/p>\n<p>\u4f7f\u7528 svg \u662f\u4e00\u79cd\u53ef\u884c\u7684\u89e3\u51b3\u65b9\u6848\u3002svg \u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a<\/p>\n<ul>\n<li>\u53ef\u4ee5\u81ea\u7531\u63a7\u5236\u7ebf\u6761\u8d70\u5411\u3001\u5706\u89d2\u5927\u5c0f\u3001\u989c\u8272\u3001\u7c97\u7ec6\u3001\u865a\u7ebf\u6b65\u957f\u7b49\u3002<\/li>\n<li>\u53ef\u4ee5\u81ea\u7531\u63a7\u5236\u52a8\u753b\u5feb\u6162\u3002<\/li>\n<li>\u53ef\u4ee5\u7ed3\u5408\u9700\u6c42\u663e\u793a\u6216\u9690\u85cf svg\uff0c\u5b9e\u73b0\u6d41\u7a0b\u8fd0\u884c\u6216\u505c\u6b62\u72b6\u6001\u3002<\/li>\n<\/ul>\n<p>\u4e0b\u9762\u662f\u4e00\u6bb5\u793a\u4f8b svg \u4ee3\u7801\uff1a<\/p>\n<pre>&lt;!DOCTYPE html&gt;\n&lt;html lang=\"en\"&gt;\n&lt;head&gt;\n  &lt;meta charset=\"UTF-8\"&gt;\n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"&gt;\n  &lt;title&gt;Animated SVG Curve&lt;\/title&gt;\n  &lt;style&gt;\n    @keyframes dash {\n      to {\n        stroke-dashoffset: -100%;\n      }\n    }\n\n    .path {\n      stroke: rgb(247, 24, 8);\n      stroke-width: 4;\n      fill: none;\n      stroke-dasharray: 8;\n      animation: dash 10s linear infinite;\n    }\n  &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n  &lt;svg width=\"600\" height=\"400\" viewBox=\"0 0 600 400\"&gt;\n    &lt;path class=\"path\" d=\"M50,150 C150,100 350,500 1550,200\" \/&gt;\n  &lt;\/svg&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<p>\u901a\u8fc7\u7814\u7a76 svg \u7684\u8def\u5f84\u5199\u6cd5\uff0c\u53ef\u4ee5\u81ea\u7531\u63a7\u5236\u6d41\u7a0b\u56fe\u4e2d\u7ebf\u6761\u7684\u8d70\u5411\u548c\u5f2f\u66f2\u7a0b\u5ea6\u3002\u7ed3\u5408\u52a8\u753b\u6548\u679c\uff0c\u53ef\u4ee5\u5b9e\u73b0\u52a8\u6001\u6d41\u5411\u3002\u8fd8\u53ef\u4ee5\u6839\u636e\u9700\u6c42\u52a8\u6001\u663e\u793a\u6216\u9690\u85cf svg\uff0c\u4ee5\u5b9e\u73b0\u6d41\u7a0b\u8fd0\u884c\u6216\u505c\u6b62\u72b6\u6001\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c31\u662f\u672c\u6587\u7684\u5168\u90e8\u5185\u5bb9\u4e86\uff0c\u662f\u5426\u6709\u987a\u5229\u5e2e\u52a9\u4f60\u89e3\u51b3\u95ee\u9898\uff1f\u82e5\u662f\u80fd\u7ed9\u4f60\u5e26\u6765\u5b66\u4e60\u4e0a\u7684\u5e2e\u52a9\uff0c\u8bf7\u5927\u5bb6\u591a\u591a\u652f\u6301\u7c73\u4e91\uff01\u66f4\u591a\u5173\u4e8e\u6587\u7ae0\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u4e5f\u53ef\u5173\u6ce8\u7c73\u4e91\u516c\u4f17\u53f7\u3002<\/p>\n<dl>\n<dt><\/dt>\n<dd>\n   Win11\u805a\u7126\u56fe\u7247\u4e0d\u81ea\u52a8\u66f4\u65b0\u600e\u4e48\u529e Win11\u805a\u7126\u56fe\u7247\u4e0d\u81ea\u52a8\u66f4\u65b0\u95ee\u9898\u89e3\u6790\n <\/dd>\n<\/dl>\n","protected":false},"excerpt":{"rendered":"<p>Vue3+Vite\u9879\u76ee\u4e2d\u5982\u4f55\u7528SVG\u5b9e\u73b0\u52a8\u6001\u6d41\u7a0b\u56fe\u5927\u5c4f\u6548\u679c\uff1f \u7c73\u4e91\u4eca\u5929\u5c06\u7ed9\u5927\u5bb6\u5e26\u6765\u300aVue3+Vite\u9879\u76ee\u4e2d\u5982\u4f55\u7528SVG\u5b9e\u73b0\u52a8\u6001\u6d41\u7a0b\u56fe\u5927\u5c4f\u6548\u679c\uff1f\u300b\uff0c\u611f\u5174\u8da3\u7684\u670b\u53cb\u8bf7\u7ee7\u7eed\u770b\u4e0b\u53bb\u5427\uff01\u4ee5\u4e0b\u5185\u5bb9\u5c06\u4f1a\u6d89\u53ca\u5230\u7b49\u7b49\u77e5\u8bc6\u70b9\uff0c\u5982\u679c\u4f60\u662f\u6b63\u5728\u5b66\u4e60\u6587\u7ae0\u6216\u8005\u5df2\u7ecf\u662f\u5927\u4f6c\u7ea7\u522b\u4e86\uff0c\u90fd\u975e\u5e38\u6b22\u8fce\u4e5f\u5e0c\u671b\u5927\u5bb6\u90fd\u80fd\u7ed9\u6211\u5efa\u8bae\u8bc4\u8bba\u54c8~\u5e0c\u671b\u80fd\u5e2e\u52a9\u5230\u5927\u5bb6\uff01 \u5b9e\u73b0\u6d41\u7a0b\u56fe\u5927\u5c4f\u7684\u65b9\u6848 \u5728 vue3 + vite \u7684\u9879\u76ee\u4e2d\uff0c\u9700\u8981\u5b9e\u73b0\u4e00\u4e2a\u6d41\u7a0b\u56fe\u548c\u5927\u5c4f\u6548\u679c\u3002\u6d41\u7a0b\u56fe\u4e2d\u5404\u6d41\u7a0b\u4e4b\u95f4\u9700\u8981\u6709\u52a8\u6001\u6d41\u5411\u3002\u5982\u4f55\u5b9e\u73b0\u8fd9\u4e2a\u6548\u679c\u5462\uff1f \u4f7f\u7528 svg \u662f\u4e00\u79cd\u53ef\u884c\u7684\u89e3\u51b3\u65b9\u6848\u3002svg \u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a \u53ef\u4ee5\u81ea\u7531\u63a7\u5236\u7ebf\u6761\u8d70\u5411\u3001\u5706\u89d2\u5927\u5c0f\u3001\u989c\u8272\u3001\u7c97\u7ec6\u3001\u865a\u7ebf\u6b65\u957f\u7b49\u3002 \u53ef\u4ee5\u81ea\u7531\u63a7\u5236\u52a8\u753b\u5feb\u6162\u3002 \u53ef\u4ee5\u7ed3\u5408\u9700\u6c42\u663e\u793a\u6216\u9690\u85cf svg\uff0c\u5b9e\u73b0\u6d41\u7a0b\u8fd0\u884c\u6216\u505c\u6b62\u72b6\u6001\u3002 \u4e0b\u9762\u662f\u4e00\u6bb5\u793a\u4f8b svg \u4ee3\u7801\uff1a &lt;!DOCTYPE html&gt; &lt;html lang=&#8221;en&#8221;&gt; &lt;head&gt; &lt;meta charset=&#8221;UTF-8&#8243;&gt; &lt;meta name=&#8221;viewport&#8221; content=&#8221;width=device-width, initial-scale=1.0&#8243;&gt; &lt;title&gt;Animated SVG Curve&lt;\/title&gt; &lt;style&gt; @keyframes dash { to { stroke-dashoffset: -100%; } } .path { stroke: rgb(247, 24, 8); stroke-width: 4; fill: none; stroke-dasharray: 8; [&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-53246","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53246","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=53246"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/53246\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=53246"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=53246"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=53246"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}