{"id":5973,"date":"2024-04-17T23:24:02","date_gmt":"2024-04-17T15:24:02","guid":{"rendered":"http:\/\/zyg.luchers.cn\/?p=5973"},"modified":"2024-04-17T23:24:02","modified_gmt":"2024-04-17T15:24:02","slug":"%e4%b8%80%e3%80%81vue3%e7%ae%80%e4%bb%8b","status":"publish","type":"post","link":"http:\/\/zyg.luchers.cn\/index.php\/2024\/04\/17\/%e4%b8%80%e3%80%81vue3%e7%ae%80%e4%bb%8b\/","title":{"rendered":"\u4e00\u3001Vue3\u7b80\u4ecb"},"content":{"rendered":"<p>Vue3\u5feb\u901f\u4e0a\u624b<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/user-images.githubusercontent.com\/499550\/93624428-53932780-f9ae-11ea-8d16-af949e16a09f.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/user-images.githubusercontent.com\/499550\/93624428-53932780-f9ae-11ea-8d16-af949e16a09f.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" style=\"width:200px\" \/><\/div><\/p>\n<h2>1.Vue3\u7b80\u4ecb<\/h2>\n<ul>\n<li>2020\u5e749\u670818\u65e5\uff0cVue.js\u53d1\u5e033.0\u7248\u672c\uff0c\u4ee3\u53f7\uff1aOne Piece\uff08\u6d77\u8d3c\u738b\uff09<\/li>\n<li>\u8017\u65f62\u5e74\u591a\u3001<a href=\"https:\/\/github.com\/vuejs\/vue-next\/graphs\/commit-activity\">2600+\u6b21\u63d0\u4ea4<\/a>\u3001<a href=\"https:\/\/github.com\/vuejs\/rfcs\/tree\/master\/active-rfcs\">30+\u4e2aRFC<\/a>\u3001<a href=\"https:\/\/github.com\/vuejs\/vue-next\/pulls?q=is%3Apr+is%3Amerged+-author%3Aapp%2Fdependabot-preview+\">600+\u6b21PR<\/a>\u3001<a href=\"https:\/\/github.com\/vuejs\/vue-next\/graphs\/contributors\">99\u4f4d\u8d21\u732e\u8005<\/a> <\/li>\n<li>github\u4e0a\u7684tags\u5730\u5740\uff1a<a href=\"https:\/\/github.com\/vuejs\/vue-next\/releases\/tag\/v3.0.0\">https:\/\/github.com\/vuejs\/vue-next\/releases\/tag\/v3.0.0<\/a><\/li>\n<\/ul>\n<h2>2.Vue3\u5e26\u6765\u4e86\u4ec0\u4e48<\/h2>\n<h3>1.\u6027\u80fd\u7684\u63d0\u5347<\/h3>\n<ul>\n<li>\n<p>\u6253\u5305\u5927\u5c0f\u51cf\u5c1141%<\/p>\n<\/li>\n<li>\n<p>\u521d\u6b21\u6e32\u67d3\u5feb55%, \u66f4\u65b0\u6e32\u67d3\u5feb133%<\/p>\n<\/li>\n<li>\n<p>\u5185\u5b58\u51cf\u5c1154%<\/p>\n<p>......<\/p>\n<\/li>\n<\/ul>\n<h3>2.\u6e90\u7801\u7684\u5347\u7ea7<\/h3>\n<ul>\n<li>\n<p>\u4f7f\u7528Proxy\u4ee3\u66ffdefineProperty\u5b9e\u73b0\u54cd\u5e94\u5f0f<\/p>\n<\/li>\n<li>\n<p>\u91cd\u5199\u865a\u62dfDOM\u7684\u5b9e\u73b0\u548cTree-Shaking<\/p>\n<p>......<\/p>\n<\/li>\n<\/ul>\n<h3>3.\u62e5\u62b1TypeScript<\/h3>\n<ul>\n<li>Vue3\u53ef\u4ee5\u66f4\u597d\u7684\u652f\u6301TypeScript<\/li>\n<\/ul>\n<h3>4.\u65b0\u7684\u7279\u6027<\/h3>\n<ol>\n<li>\n<p>Composition API\uff08\u7ec4\u5408API\uff09<\/p>\n<ul>\n<li>setup\u914d\u7f6e<\/li>\n<li>ref\u4e0ereactive<\/li>\n<li>watch\u4e0ewatchEffect<\/li>\n<li>provide\u4e0einject<\/li>\n<li>......<\/li>\n<\/ul>\n<\/li>\n<li>\u65b0\u7684\u5185\u7f6e\u7ec4\u4ef6\n<ul>\n<li>Fragment <\/li>\n<li>Teleport<\/li>\n<li>Suspense<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u5176\u4ed6\u6539\u53d8<\/p>\n<ul>\n<li>\u65b0\u7684\u751f\u547d\u5468\u671f\u94a9\u5b50<\/li>\n<li>data \u9009\u9879\u5e94\u59cb\u7ec8\u88ab\u58f0\u660e\u4e3a\u4e00\u4e2a\u51fd\u6570<\/li>\n<li>\u79fb\u9664keyCode\u652f\u6301\u4f5c\u4e3a v-on \u7684\u4fee\u9970\u7b26<\/li>\n<li>......<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<h1>\u4e00\u3001\u521b\u5efaVue3.0\u5de5\u7a0b<\/h1>\n<h2>1.\u4f7f\u7528 vue-cli \u521b\u5efa<\/h2>\n<p>\u5b98\u65b9\u6587\u6863\uff1a<a href=\"https:\/\/cli.vuejs.org\/zh\/guide\/creating-a-project.html#vue-create\">https:\/\/cli.vuejs.org\/zh\/guide\/creating-a-project.html#vue-create<\/a><\/p>\n<pre><code class=\"language-bash\">## \u67e5\u770b@vue\/cli\u7248\u672c\uff0c\u786e\u4fdd@vue\/cli\u7248\u672c\u57284.5.0\u4ee5\u4e0a\nvue --version\n## \u5b89\u88c5\u6216\u8005\u5347\u7ea7\u4f60\u7684@vue\/cli\nnpm install -g @vue\/cli\n## \u521b\u5efa\nvue create vue_test\n## \u542f\u52a8\ncd vue_test\nnpm run serve<\/code><\/pre>\n<h2>2.\u4f7f\u7528 vite \u521b\u5efa<\/h2>\n<p>\u5b98\u65b9\u6587\u6863\uff1a<a href=\"https:\/\/v3.cn.vuejs.org\/guide\/installation.html#vite\">https:\/\/v3.cn.vuejs.org\/guide\/installation.html#vite<\/a><\/p>\n<p>vite\u5b98\u7f51\uff1a<a href=\"https:\/\/vitejs.cn\">https:\/\/vitejs.cn<\/a><\/p>\n<ul>\n<li>\u4ec0\u4e48\u662fvite\uff1f\u2014\u2014 \u65b0\u4e00\u4ee3\u524d\u7aef\u6784\u5efa\u5de5\u5177\u3002<\/li>\n<li>\u4f18\u52bf\u5982\u4e0b\uff1a\n<ul>\n<li>\u5f00\u53d1\u73af\u5883\u4e2d\uff0c\u65e0\u9700\u6253\u5305\u64cd\u4f5c\uff0c\u53ef\u5feb\u901f\u7684\u51b7\u542f\u52a8\u3002<\/li>\n<li>\u8f7b\u91cf\u5feb\u901f\u7684\u70ed\u91cd\u8f7d\uff08HMR\uff09\u3002<\/li>\n<li>\u771f\u6b63\u7684\u6309\u9700\u7f16\u8bd1\uff0c\u4e0d\u518d\u7b49\u5f85\u6574\u4e2a\u5e94\u7528\u7f16\u8bd1\u5b8c\u6210\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<pre><code class=\"language-bash\">## \u521b\u5efa\u5de5\u7a0b\nnpm init vite-app &lt;project-name&gt;\n## \u8fdb\u5165\u5de5\u7a0b\u76ee\u5f55\ncd &lt;project-name&gt;\n## \u5b89\u88c5\u4f9d\u8d56\nnpm install\n## \u8fd0\u884c\nnpm run dev<\/code><\/pre>\n<h1><\/h1>\n","protected":false},"excerpt":{"rendered":"<p>Vue3\u5feb\u901f\u4e0a\u624b 1.Vue3\u7b80\u4ecb 2020\u5e749\u670818\u65e5\uff0cVue.js\u53d1\u5e033.0\u7248\u672c\uff0c\u4ee3\u53f7\uff1aOne Piece [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[61],"tags":[],"class_list":["post-5973","post","type-post","status-publish","format-standard","hentry","category-vue3"],"_links":{"self":[{"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/posts\/5973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/comments?post=5973"}],"version-history":[{"count":1,"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/posts\/5973\/revisions"}],"predecessor-version":[{"id":5974,"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/posts\/5973\/revisions\/5974"}],"wp:attachment":[{"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/media?parent=5973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/categories?post=5973"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/zyg.luchers.cn\/index.php\/wp-json\/wp\/v2\/tags?post=5973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}