{"id":21270,"date":"2024-11-19T08:20:07","date_gmt":"2024-11-19T00:20:07","guid":{"rendered":"https:\/\/fwq.ai\/blog\/21270\/"},"modified":"2024-11-19T08:20:07","modified_gmt":"2024-11-19T00:20:07","slug":"vscode%e6%80%8e%e4%b9%88%e8%bf%90%e8%a1%8cvue%e9%a1%b9%e7%9b%ae","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/21270\/","title":{"rendered":"vscode\u600e\u4e48\u8fd0\u884cvue\u9879\u76ee"},"content":{"rendered":"<blockquote><p>\n  \u5728 vs code \u4e2d\u8fd0\u884c vue \u9879\u76ee\uff1a\u6253\u5f00\u9879\u76ee\u6587\u4ef6\u5939\uff0c\u5b89\u88c5\u4f9d\u8d56\u9879\uff08npm install\uff09\uff0c\u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668\uff08npm run serve\uff09\uff0c\u8bbf\u95ee\u5f00\u53d1\u670d\u52a1\u5668\uff08http:\/\/localhost:8080\uff09\uff0c\u8c03\u8bd5\u9879\u76ee\uff08\u53ef\u9009\uff09\u3002\u5176\u4ed6\u63d0\u793a\uff1a\u542f\u7528\u70ed\u91cd\u8f7d\uff0c\u914d\u7f6e\u7aef\u53e3\uff0c\u4f7f\u7528\u6269\u5c55\u3002\n<\/p><\/blockquote>\n<p><img decoding=\"async\" src=\"https:\/\/img.php.cn\/upload\/article\/202405\/15\/2024051505421892630.jpg\" class=\"aligncenter\" title=\"vscode\u600e\u4e48\u8fd0\u884cvue\u9879\u76ee\u63d2\u56fe\" alt=\"vscode\u600e\u4e48\u8fd0\u884cvue\u9879\u76ee\u63d2\u56fe\" \/><\/p>\n<p><strong>\u5982\u4f55\u4f7f\u7528 VS Code \u8fd0\u884c Vue \u9879\u76ee<\/strong><\/p>\n<p><strong>1. \u6253\u5f00\u9879\u76ee<\/strong><\/p>\n<ul>\n<li>\u5728 VS Code \u4e2d\uff0c\u5355\u51fb\u201c\u6587\u4ef6\u201d&gt;\u201c\u6253\u5f00\u6587\u4ef6\u5939\u201d\uff0c\u9009\u62e9\u5305\u542b Vue \u9879\u76ee\u7684\u6587\u4ef6\u5939\u3002<\/li>\n<\/ul>\n<p><strong>2. \u5b89\u88c5\u4f9d\u8d56\u9879<\/strong><\/p>\n<ul>\n<li>\n<p>\u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u5bfc\u822a\u5230\u9879\u76ee\u6587\u4ef6\u5939\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n<p><span>\u7acb\u5373\u5b66\u4e60<\/span>\u201c\u201d\uff1b<\/p>\n<pre>npm install<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>3. \u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668<\/strong><\/p>\n<ul>\n<li>\u5728 VS Code \u4e2d\uff0c\u6253\u5f00\u201c\u7ec8\u7aef\u201d\u9762\u677f\uff08View &gt; Terminal\uff09\u3002<\/li>\n<li>\n<p>\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668\uff1a<\/p>\n<pre>npm run serve<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>4. \u8bbf\u95ee\u5f00\u53d1\u670d\u52a1\u5668<\/strong><\/p>\n<ul>\n<li>\u5f00\u53d1\u670d\u52a1\u5668\u5c06\u5728\u9ed8\u8ba4\u7aef\u53e3\uff08\u901a\u5e38\u4e3a 8080\uff09\u4e0a\u542f\u52a8\u3002<\/li>\n<li>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\uff0c\u5bfc\u822a\u5230\u4ee5\u4e0b\u5730\u5740\uff1a<\/p>\n<pre>http:\/\/localhost:8080<\/pre>\n<p> \u767b\u5f55\u540e\u590d\u5236 <\/li>\n<\/ul>\n<p><strong>5. \u8c03\u8bd5\u9879\u76ee\uff08\u53ef\u9009\uff09<\/strong><\/p>\n<ul>\n<li>\u8981\u8c03\u8bd5\u9879\u76ee\uff0c\u8bf7\u5728 VS Code \u4e2d\u6253\u5f00\u201c\u8c03\u8bd5\u201d\u9762\u677f\uff08View &gt; Debug\uff09\u3002<\/li>\n<li>\u5355\u51fb\u201c\u542f\u52a8\u201d\u6309\u94ae\uff08\u7eff\u8272\u4e09\u89d2\u5f62\u56fe\u6807\uff09\u542f\u52a8\u8c03\u8bd5\u4f1a\u8bdd\u3002<\/li>\n<\/ul>\n<p><strong>\u5176\u4ed6\u63d0\u793a\uff1a<\/strong><\/p>\n<ul>\n<li> <strong>\u542f\u7528\u70ed\u91cd\u8f7d\uff1a<\/strong>\u70ed\u91cd\u8f7d\u5141\u8bb8\u5728\u4ee3\u7801\u66f4\u6539\u65f6\u81ea\u52a8\u5237\u65b0\u6d4f\u89c8\u5668\u3002\u8981\u542f\u7528\u5b83\uff0c\u8bf7\u5728 .config.js \u6587\u4ef6\u4e2d\u8bbe\u7f6e devServer.hot: true\u3002<\/li>\n<li> <strong>\u914d\u7f6e\u7aef\u53e3\uff1a<\/strong>\u60a8\u53ef\u4ee5\u901a\u8fc7\u5728 vue.config.js \u6587\u4ef6\u4e2d\u8bbe\u7f6e devServer.port \u6765\u914d\u7f6e\u5f00\u53d1\u670d\u52a1\u5668\u7684\u7aef\u53e3\u3002<\/li>\n<li> <strong>\u4f7f\u7528\u6269\u5c55\uff1a<\/strong>\u6709\u591a\u79cd VS Code \u6269\u5c55\u53ef\u4ee5\u589e\u5f3a Vue \u9879\u76ee\u7684\u5f00\u53d1\u4f53\u9a8c\uff0c\u4f8b\u5982 Vetur \u548c Vue.js Extension Pack\u3002<\/li>\n<\/ul>\n<p>\u4ee5\u4e0a\u5c31\u662f\u600e\u4e48\u8fd0\u884c\u9879\u76ee\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>\u5728 vs code \u4e2d\u8fd0\u884c vue \u9879\u76ee\uff1a\u6253\u5f00\u9879\u76ee\u6587\u4ef6\u5939\uff0c\u5b89\u88c5\u4f9d\u8d56\u9879\uff08npm install\uff09\uff0c\u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668\uff08npm run serve\uff09\uff0c\u8bbf\u95ee\u5f00\u53d1\u670d\u52a1\u5668\uff08http:\/\/localhost:8080\uff09\uff0c\u8c03\u8bd5\u9879\u76ee\uff08\u53ef\u9009\uff09\u3002\u5176\u4ed6\u63d0\u793a\uff1a\u542f\u7528\u70ed\u91cd\u8f7d\uff0c\u914d\u7f6e\u7aef\u53e3\uff0c\u4f7f\u7528\u6269\u5c55\u3002 \u5982\u4f55\u4f7f\u7528 VS Code \u8fd0\u884c Vue \u9879\u76ee 1. \u6253\u5f00\u9879\u76ee \u5728 VS Code \u4e2d\uff0c\u5355\u51fb\u201c\u6587\u4ef6\u201d&gt;\u201c\u6253\u5f00\u6587\u4ef6\u5939\u201d\uff0c\u9009\u62e9\u5305\u542b Vue \u9879\u76ee\u7684\u6587\u4ef6\u5939\u3002 2. \u5b89\u88c5\u4f9d\u8d56\u9879 \u5728\u7ec8\u7aef\u6216\u547d\u4ee4\u63d0\u793a\u7b26\u4e2d\uff0c\u5bfc\u822a\u5230\u9879\u76ee\u6587\u4ef6\u5939\uff0c\u7136\u540e\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a \u7acb\u5373\u5b66\u4e60\u201c\u201d\uff1b npm install \u767b\u5f55\u540e\u590d\u5236 3. \u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668 \u5728 VS Code \u4e2d\uff0c\u6253\u5f00\u201c\u7ec8\u7aef\u201d\u9762\u677f\uff08View &gt; Terminal\uff09\u3002 \u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8\u5f00\u53d1\u670d\u52a1\u5668\uff1a npm run serve \u767b\u5f55\u540e\u590d\u5236 4. \u8bbf\u95ee\u5f00\u53d1\u670d\u52a1\u5668 \u5f00\u53d1\u670d\u52a1\u5668\u5c06\u5728\u9ed8\u8ba4\u7aef\u53e3\uff08\u901a\u5e38\u4e3a 8080\uff09\u4e0a\u542f\u52a8\u3002 \u5728\u6d4f\u89c8\u5668\u4e2d\uff0c\u5bfc\u822a\u5230\u4ee5\u4e0b\u5730\u5740\uff1a http:\/\/localhost:8080 \u767b\u5f55\u540e\u590d\u5236 5. \u8c03\u8bd5\u9879\u76ee\uff08\u53ef\u9009\uff09 \u8981\u8c03\u8bd5\u9879\u76ee\uff0c\u8bf7\u5728 VS Code [&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-21270","post","type-post","status-publish","format-standard","hentry","category-16"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21270","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=21270"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/21270\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=21270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=21270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=21270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}