{"id":229080,"date":"2021-11-06T09:14:30","date_gmt":"2021-11-06T01:14:30","guid":{"rendered":"https:\/\/gulass.cn\/?p=229080"},"modified":"2021-10-24T15:15:41","modified_gmt":"2021-10-24T07:15:41","slug":"vue-project-debug","status":"publish","type":"post","link":"https:\/\/gulass.cn\/vue-project-debug.html","title":{"rendered":"Vue\u9879\u76ee\u8c03\u8bd5\u6280\u80fd"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u5728Vue\u9879\u76ee\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u5f53\u4f60\u9047\u5230\u5e94\u7528\u903b\u8f91\u51fa\u73b0\u9519\u8bef\uff0c\u4f46\u53c8\u65e0\u6cd5\u51c6\u786e\u5b9a\u4f4d\u7684\u65f6\u5019\uff0c\u77e5\u6653Vue\u9879\u76ee\u8c03\u8bd5\u6280\u5de7\u81f3\u5173\u91cd\u8981\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u540c\u540e\u53f0\u9879\u76ee\u5f00\u53d1\u4e00\u6837\uff0c\u53ef\u4ee5\u5728JS\u5b9e\u73b0\u7684\u5e94\u7528\u903b\u8f91\u4e2d\u8bbe\u7f6e\u65ad\u70b9\uff0c\u5e76\u8fdb\u884c\u5355\u6b65\u3001\u8fdb\u5165\u65b9\u6cd5\u5185\u3001\u8df3\u51fa\u65b9\u6cd5\u7b49\u8c03\u8bd5\uff0c\u4ece\u800c\u51c6\u786e\u5b9a\u4f4d\u95ee\u9898\u6839\u6e90\u3002<\/p>\n

\u672c\u6587\u4e3b\u8981\u9488\u5bf9JetBrains\u7cfb\u5217WebStorm\u4e0bVue\u9879\u76ee\u8fdb\u884c\u8c03\u8bd5\u76842\u79cd\u65b9\u6cd5\uff1adebugger\u548cVue-devtools\u3002<\/p>\n

debugger<\/strong><\/div>\n

debugger\u662f\u8c37\u6b4c\u6d4f\u89c8\u5668\u63d0\u4f9b\u7684\u8c03\u8bd5\u8bed\u53e5\uff0c\u5176\u4e3b\u8981\u662f\u901a\u8fc7\u505c\u6b62JS\u7684\u6267\u884c\uff0c\u76f8\u5f53\u4e8e\u8bbe\u7f6e\u65ad\u70b9\u3002\u5b83\u7684\u4f7f\u7528\u65b9\u6cd5\u5f88\u7b80\u5355\uff0c \u53ea\u9700\u8981\u5728\u6211\u4eec\u7684JS\u8bed\u53e5\u4e2d\uff0c \u63d2\u5165\u4e00\u884cdebugger; \u5373\u53ef\u3002<\/p>\n

\u5728JS\u4ee3\u7801\u7f16\u5199\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6211\u4eec\u90fd\u4f1a\u901a\u8fc7\u6d4f\u89c8\u5668\u7684\u8c03\u8bd5\u6a21\u5f0f\uff08F12\uff09\u6765\u68c0\u67e5\u4ee3\u7801\u903b\u8f91\u662f\u5426\u6b63\u786e\uff0c\u5927\u591a\u6570\u6211\u4eec\u90fd\u662f\u901a\u8fc7\u8bbe\u7f6e\u65ad\u70b9\u6765\u8fdb\u884c\u8c03\u8bd5\u3002<\/p>\n

\u5e94\u7528debugger\u8c03\u8bd5Vue\u9879\u76ee\uff0c\u9700\u8981\u5728\u9879\u76ee\u4e2d\u9700\u8981\u7684\u4f4d\u7f6e\u5199debugger,\u9879\u76ee\u8fd0\u884c\u540e\uff0c\u6253\u5f00\u6d4f\u89c8\u5668\u6309F12\uff0c\u5728chrome sources\u9875\u7b7e\u4e2d\u5c31\u4f1a\u76f4\u63a5\u8fdb\u5165\u65ad\u70b9\uff0c\u81f3\u6b64\u53ef\u4ee5\u8fdb\u884c\u5355\u6b65\u3001\u8df3\u6b65\u8c03\u8bd5\u4e86\u3002<\/p>\n

Vue-devtools<\/strong><\/div>\n

\u8be5\u8c03\u8bd5\u5de5\u5177\u4e3a\u9488\u5bf9Chrome\u6d4f\u89c8\u5668\u800c\u8bbe\u8ba1\u7684\u5f00\u6e90\u8c03\u8bd5\u5de5\u5177\uff08Github\u5730\u5740\uff09\uff0c\u53ef\u4ee5\u81ea\u884c\u5c06\u8be5\u9879\u76ee\u4e0b\u8f7d\u4e0b\u6765\u7136\u540e\u7f16\u8bd1\uff0c\u5e76\u5c06\u751f\u6210\u540e\u7684chrome\u63d2\u4ef6\u5b89\u88c5\u81f3chrome\u4e2d\uff0c\u6b65\u9aa4\u5982\u4e0b\uff1a
\n\u627e\u5230\u8c37\u6b4c\u6d4f\u89c8\u5668\u7684\u6269\u5c55\u7a0b\u5e8f\u529f\u80fd\uff0c\u52fe\u9009\u5f00\u53d1\u8005\u6a21\u5f0f\uff0c\u7136\u540e\u6211\u4eec\u5c06\u63d2\u4ef6\u6587\u4ef6\u5939\u91cc\u7684shells>chorme\u6587\u4ef6\u5939\u76f4\u63a5\u62d6\u5230\u9875\u9762\u4e2d\uff0c\u5b8c\u6210\u5b89\u88c5\u3002<\/p>\n

\"\"<\/a>
\n\u7136\u540e\u8fd0\u884c\u672c\u5730\u9879\u76ee\u7528\u8c37\u6b4c\u6d4f\u89c8\u5668\u6253\u5f00\u5c31\u53ef\u4ee5\u8c03\u8bd5\u4e86\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002<\/p>\n

\"\"<\/a><\/p>\n

\u5e94\u7528devtools\u8c03\u8bd5\u5de5\u5177\uff0c\u8fd8\u9700\u8981\u5728vue\u9879\u76ee\u4e2dman.js\u9700\u8981\u914d\u7f6e\uff1a<\/p>\n

\r\n\tVue.config.devtools = true;\r\n<\/pre>\n

\u5b89\u88c5\u540e, \u9700\u8981\u5173\u95ed\u6d4f\u89c8\u5668, \u518d\u91cd\u65b0\u6253\u5f00, \u624d\u80fd\u4f7f\u7528;<\/p>\n

\u5982\u679c\u8c03\u8bd5\u63d2\u4ef6\u5b89\u88c5\u540e\uff0cvue\u9762\u677f\u672a\u51fa\u73b0\uff0c\u518d\u5230vue-devtools\u6587\u4ef6\u5939\u4e0b\u6267\u884c\u4e00\u904dnpm run dev<\/code>\u3002<\/p>\n

\u4e5f\u53ef\u4ee5\u5728\u8054\u7f51\u72b6\u6001\u4e0b\uff0c\u5728Chrome\u6216Firefox\u6d4f\u89c8\u5668\u7684\u6269\u5c55\u63d2\u4ef6\u4ed3\u5e93\u91cc\u641cvue devtool\uff0c\u5b89\u88c5Vue.js devtools\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u540c\u540e\u53f0\u9879\u76ee\u5f00\u53d1\u4e00\u6837\uff0c\u53ef\u4ee5\u5728JS\u5b9e\u73b0\u7684\u5e94\u7528\u903b\u8f91\u4e2d\u8bbe\u7f6e\u65ad\u70b9\uff0c\u5e76\u8fdb\u884c\u5355\u6b65\u3001\u8fdb\u5165\u65b9\u6cd5\u5185\u3001\u8df3\u51fa\u65b9\u6cd5\u7b49\u8c03\u8bd5\uff0c\u4ece\u800c\u51c6\u786e\u5b9a\u4f4d\u95ee […]<\/p>\n","protected":false},"author":1903,"featured_media":229087,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-229080","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/229080","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1903"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=229080"}],"version-history":[{"count":1,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/229080\/revisions"}],"predecessor-version":[{"id":229093,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/229080\/revisions\/229093"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/229087"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=229080"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=229080"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=229080"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}