vue 3 code example
Example 1: install vue js
npm install -g vue-cli //make sure you have node and npm installed
vue init webpack <appname> // eg: vue init webpack myapp
cd <appname> // cd myapp
npm install
npm run dev //server will start in port 8080
Example 2: vue 3
<script src="https://unpkg.com/vue@next"></script> # CDN Version
# NPM or Yarn Version
npm install vue@next
#Vue 3 CLI Installation
yarn global add @vue/cli
# OR
npm install -g @vue/cli
# Vue CLI Create Project
vue create my-project
Example 3: install vue js
# latest stable
$ npm install vue
Example 4: vue js documentation
new Vue({
el: '#app',
data: {
message: 'Hello Vue.js!'
}
})
Example 5: vuejs
var app = new Vue({
el: '#app',
data: {
message: 'Hello Vue!'
}
})
Example 6: vue js documentation
<div id="app">
{{ message }}
</div>