How to create a Vue Js project

Ericko wicaksono
Ericko wicaksono

vue-image

Crete a vue js project are can be done in several way. Before that, any of you are familiar with Vue Js?. Vue js are one of javascript framework ui. This framework can make your life easier when make a website. There are some other framework that maybe can you used like React Js, Svelte, or Angular. Installing a vue project are same with installing other javascript framework. There are several way to install it.

Install with CDN

What you can do when using CDN are copy the script tag to your project. There are some way that you can using. First one are from jsdelivr build version. for example you want to using vue js with version vue@2.6.12.

1<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.js"></script>

or Also, you can use with specific number to avoid the breaking changes.

1<script src="https://cdn.jsdelivr.net/npm/vue@2.6.12"></script>

or If you are using native ES Modules, there is also an ES Modules compatible build:

<script type="module"> import Vue from 'https://cdn.jsdelivr.net/npm/vue@2.6.12/dist/vue.esm.browser.js' </script>

You can browse the source of the NPM package at jsdelivr site.

Install with NPM

To installing with NPM, absolutely you must have installed NPM. After that you can run this to your terminal

1# latest stable
2npm install vue

Install with CLI

Same like installing with NPM version but installing with CLI have more advantages. If you want to build a vue project with build in configured feature. Like hot reload, lint on save, and production ready build. Also, when running the project you can use the GUI or interface to install a vue project. I recommend to use installing with CLI version if you really want that feature.

1npm install -g @vue/cli
2# OR
3yarn global add @vue/cli

Conclusion

There are some ways to create a Vue Js project. You can use CDN when use vue js in other existing project with single project that have to run vue. But, i recommend to have a difference vue project and not mix in other project. That was better to maintain the project. So, you can installing Vue project with NPM and CLI according to the features you want