{"id":2066,"date":"2024-07-02T09:38:17","date_gmt":"2024-07-02T01:38:17","guid":{"rendered":"https:\/\/zhuxinyong.com\/?p=2066"},"modified":"2024-07-02T19:39:56","modified_gmt":"2024-07-02T11:39:56","slug":"%e8%b0%83%e8%af%95-vue2-%e6%ba%90%e7%a0%81","status":"publish","type":"post","link":"https:\/\/zhuxinyong.com\/?p=2066","title":{"rendered":"\u8c03\u8bd5 Vue2 \u6e90\u7801"},"content":{"rendered":"\n<p>\u6709\u65f6\u5019\u4e1a\u52a1\u4e0a\u9047\u5230\u95ee\u9898\uff0c\u9700\u8981\u8ddf\u8e2a Vue \u5e95\u5c42\u662f\u5982\u4f55\u5b9e\u73b0\u7684\u6b64\u65f6\u5c31\u9700\u8981\u8c03\u8bd5\u6e90\u7801\uff0c\u4f46\u4e1a\u52a1\u4e2d\u7684\u4ee3\u7801\u662f\u538b\u7f29\u540e\u7684\u65e0\u6cd5\u9605\u8bfb\uff0c\u6240\u4ee5\u5c31\u9700\u8981\u6574\u4e00\u4e2a\u53ef\u4ee5\u8c03\u8bd5\u7684\u7248\u672c\u3002<\/p>\n\n\n\n<p><strong>\u4e0b\u8f7d\u6e90\u7801<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">git clone https:\/\/github.com\/vuejs\/vue.git<\/code><\/pre>\n\n\n\n<p><strong>\u5b89\u88c5\u4f9d\u8d56\uff1a<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">yarn<br>\/\/ npm install<\/code><\/pre>\n\n\n\n<p><strong>\u4fee\u6539\u6784\u5efa\u547d\u4ee4<\/strong><\/p>\n\n\n\n<p>\u65b0\u589e\uff1a<code>--sourcemap<\/code><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\"dev\": \"rollup -w -c scripts\/config.js --sourcemap --environment TARGET:web-full-dev\",<\/code><\/pre>\n\n\n\n<p>\u8fd9\u6837\u5728\u8fd0\u884c&nbsp;<code>npm run dev<\/code>&nbsp;\u7684\u65f6\u5019\u5728&nbsp;<code>dist<\/code>&nbsp;\u76ee\u5f55\u4e0b\u4f1a\u8f93\u51fa soucemap \u6587\u4ef6\u3002<\/p>\n\n\n\n<p><strong>\u9879\u76ee\u6839\u76ee\u5f55\u65b0\u589e index.html \u6587\u4ef6<\/strong><\/p>\n\n\n\n<p>\u5f15\u5165&nbsp;<code>.\/dist\/vue.js<\/code>\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">&lt;!DOCTYPE html>  \n&lt;html lang=\"en\">  \n  \n&lt;head>  \n  &lt;meta charset=\"UTF-8\">  \n  &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">  \n  &lt;title>Vue debugger&lt;\/title>  \n  &lt;script src=\".\/dist\/vue.js\">&lt;\/script>  \n&lt;\/head>  \n  \n&lt;body>  \n&lt;div id=\"app\">  \n  {{ msg }}  \n&lt;\/div>  \n&lt;script>  \n  const vm = new Vue({  \n    el: '#app',  \n    data() {  \n      return {  \n        msg: 'hello world',  \n      };  \n    },  \n    created() {  \n    },  \n    methods: {  \n    }  \n  });  \n&lt;\/script>  \n&lt;\/body>  \n&lt;\/html><\/code><\/pre>\n\n\n\n<p><strong>\u9884\u89c8 HTML<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"546\" src=\"https:\/\/zhuxinyong.com\/wp-content\/uploads\/2024\/07\/image-1024x546.png\" alt=\"\" class=\"wp-image-2069\" srcset=\"https:\/\/zhuxinyong.com\/wp-content\/uploads\/2024\/07\/image-1024x546.png 1024w, https:\/\/zhuxinyong.com\/wp-content\/uploads\/2024\/07\/image-300x160.png 300w, https:\/\/zhuxinyong.com\/wp-content\/uploads\/2024\/07\/image-768x409.png 768w, https:\/\/zhuxinyong.com\/wp-content\/uploads\/2024\/07\/image-670x357.png 670w, https:\/\/zhuxinyong.com\/wp-content\/uploads\/2024\/07\/image.png 1311w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>\u6709\u65f6\u5019\u4e1a\u52a1\u4e0a\u9047\u5230\u95ee\u9898\uff0c\u9700\u8981\u8ddf\u8e2a Vue \u5e95\u5c42\u662f\u5982\u4f55\u5b9e\u73b0\u7684\u6b64\u65f6\u5c31\u9700\u8981\u8c03\u8bd5\u6e90\u7801\uff0c\u4f46\u4e1a\u52a1\u4e2d\u7684\u4ee3\u7801\u662f\u538b\u7f29\u540e\u7684&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,20],"tags":[6,47,30],"class_list":["post-2066","post","type-post","status-publish","format-standard","hentry","category-all","category-frontend","tag-javascript","tag-vue","tag-30"],"_links":{"self":[{"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/posts\/2066","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2066"}],"version-history":[{"count":5,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/posts\/2066\/revisions"}],"predecessor-version":[{"id":2072,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=\/wp\/v2\/posts\/2066\/revisions\/2072"}],"wp:attachment":[{"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2066"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/zhuxinyong.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}