{"id":470,"date":"2018-04-12T05:59:45","date_gmt":"2018-04-12T09:59:45","guid":{"rendered":"http:\/\/salzlechner.com\/dev\/?p=470"},"modified":"2018-04-12T05:59:45","modified_gmt":"2018-04-12T09:59:45","slug":"getting-started-with-vue-js-2","status":"publish","type":"post","link":"http:\/\/salzlechner.com\/dev\/2018\/04\/12\/getting-started-with-vue-js-2\/","title":{"rendered":"Getting Started with Vue.js 2"},"content":{"rendered":"<p>Setting up a new project with Vue.js 2 can be done in different ways. We are going to use the Vue cli<\/p>\n<p>In order to use the Vue-cli we need to install NPM as the Vue-cli is available as an NPM package<\/p>\n<p>after installing NPM we can install the vue-cli as follows<\/p>\n<p><span class=\"lang:default decode:true crayon-inline\">npm install -g vue-cli<\/span><\/p>\n<p>After installing the Vue cli we can use the cli command to create a new project<\/p>\n<p><span class=\"lang:default decode:true  crayon-inline \">vue init webpack myfirstvueapp<\/span><\/p>\n<p>after executing the above line vue will ask a number of questions. If you did not let vue run the install you can do that manually by using the following command from within the project folder<\/p>\n<p><span class=\"lang:default decode:true  crayon-inline \">npm install<\/span><\/p>\n<p>after installation is complete you can launch the web server in development mode as follows<\/p>\n<p><span class=\"lang:default decode:true  crayon-inline \">npm run dev<\/span><\/p>\n<p>this will launch the web server. The web server will launch on port 8080 by default if the port is available. If the port is in use the port number will increase until an open port is found.<\/p>\n<p>Later when you want to build for production you can use the following command<\/p>\n<p><span class=\"lang:default decode:true  crayon-inline \">npm run build<\/span><\/p>\n<p>this will build the production code which will then be available under the dist folder.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Setting up a new project with Vue.js 2 can be done in different ways. We are going to use the Vue cli In order to use the Vue-cli we need to install NPM as the Vue-cli is available as an NPM package after installing NPM we can install the vue-cli as follows npm install -g [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_et_pb_use_builder":"","_et_pb_old_content":"","_et_gb_content_width":"","ngg_post_thumbnail":0,"footnotes":""},"categories":[38],"tags":[],"class_list":["post-470","post","type-post","status-publish","format-standard","hentry","category-vue-js"],"_links":{"self":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/comments?post=470"}],"version-history":[{"count":2,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/470\/revisions"}],"predecessor-version":[{"id":472,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/posts\/470\/revisions\/472"}],"wp:attachment":[{"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/media?parent=470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/categories?post=470"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/salzlechner.com\/dev\/wp-json\/wp\/v2\/tags?post=470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}