{"id":10870,"date":"2020-06-06T10:46:32","date_gmt":"2020-06-06T01:46:32","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=10870"},"modified":"2023-05-27T23:58:20","modified_gmt":"2023-05-27T14:58:20","slug":"%e3%80%90vue-js%e3%80%91vue-cli%e3%81%a7%e7%94%9f%e6%88%90%e3%81%97%e3%81%9f%e3%83%95%e3%82%a1%e3%82%a4%e3%83%ab%e3%81%ae%e6%84%8f%e5%91%b3%e3%82%92%e7%90%86%e8%a7%a3%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=10870","title":{"rendered":"\u3010Vue.js\u3011Vue CLI\u3067\u751f\u6210\u3057\u305f\u30d5\u30a1\u30a4\u30eb\u306e\u610f\u5473\u3092\u7406\u89e3\u3059\u308b"},"content":{"rendered":"<h2>main.js<\/h2>\n<p>\u300cvue cli\u300d\u306e\u300cvue create\u300d\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u969b\u306bsrc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4e0b\u8a18\u306e\u30bd\u30fc\u30b9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002<span style=\"color: #ff0000;\"><strong>\u5168\u3066\u306esrc\u30d5\u30a1\u30a4\u30eb\u306e\u30c8\u30c3\u30d7\u968e\u5c64\u306e\u30d5\u30a1\u30a4\u30eb<\/strong><\/span>\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">import Vue from 'vue'\r\nimport App from '.\/App.vue'\r\n\r\nVue.config.productionTip = false\r\n\r\nnew Vue({\r\n  render: h =&gt; h(App),\r\n}).$mount('#app')<\/pre>\n<h2>import Vue from 'vue'<\/h2>\n<p>package.json\u306e\u4e0b\u8a18\u306e\u2605\u3092\u3064\u3051\u305f\u7b87\u6240\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3053\u3068\u3067\u4f7f\u3048\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">  \"dependencies\": {\r\n    \"core-js\": \"^3.6.5\",\r\n    \"vue\": \"^2.6.11\"\u3000\u2605\r\n  },<\/pre>\n<div>\n<h2>import App from '.\/App.vue'<\/h2>\n<p>App.vue\u306fSFC\u3067import\u3059\u308b\u4e8b\u3067main.js\u5185\u3067<span style=\"color: #ff0000;\"><strong>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8<\/strong><\/span>\u3068\u3057\u3066\u4f7f\u7528\u3059\u308b\u4e8b\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h2>Vue.config.productionTip = false<\/h2>\n<div>\u672c\u756a\u74b0\u5883\u7528\u306eTips\u3092\u975e\u8868\u793a\u306b\u3057\u3066\u3044\u307e\u3059\u3002true\u306b\u3059\u308b\u3068Developer Tool\u306b\u60c5\u5831\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002\u305d\u3093\u306a\u306b\u5fc5\u8981\u306a\u3044\u306e\u3067false\u306e\u307e\u307e\u306b\u3057\u3066\u304a\u304f\u3068\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/div>\n<\/div>\n<h2>render: h =&gt; h(App),<\/h2>\n<p>App.vue\uff08\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\uff09\u3092\u30ec\u30f3\u30c0\u30ea\u30f3\u30b0\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>new Vue({ render: h =&gt; h(App), }).$mount('#app')<\/h2>\n<p>new\u3067\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\u3057\u305f\u4e0a\u3067#app\u3068\u3044\u3046DOM\u306b\u30de\u30a6\u30f3\u30c8\u3057\u3066\u3044\u308b\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u3053\u306e#app\u3068\u3044\u3046\u306e\u306fpublic\u30d5\u30a9\u30eb\u30c0\u5185\u306eindex.html\u306b\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>public\/index.html<\/h3>\n<pre class=\"lang:default decode:true  \">&lt;body&gt;\r\n  &lt;noscript&gt;\r\n    &lt;strong&gt;We're sorry but &lt;%= htmlWebpackPlugin.options.title %&gt; doesn't work properly without JavaScript enabled. Please enable it to continue.&lt;\/strong&gt;\r\n  &lt;\/noscript&gt;\r\n  &lt;div id=\"app\"&gt;&lt;\/div&gt;\r\n  &lt;!-- built files will be auto injected --&gt;\r\n&lt;\/body&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"main.js \u300cvue cli\u300d\u306e\u300cvue create\u300d\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u305f\u969b\u306bsrc\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u4e0b\u8a18\u306e\u30bd\u30fc\u30b9\u304c\u751f\u6210\u3055\u308c\u307e\u3059\u3002\u5168\u3066\u306esrc\u30d5\u30a1\u30a4\u30eb\u306e\u30c8\u30c3\u30d7\u968e\u5c64\u306e\u30d5\u30a1\u30a4\u30eb\u3067\u3059\u3002 import Vue from 'vue [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[60],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10870"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10870"}],"version-history":[{"count":7,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10870\/revisions"}],"predecessor-version":[{"id":20623,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/10870\/revisions\/20623"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10870"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10870"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10870"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}