SlideShare a Scribd company logo

Vue.JS - Introduction
Eueung Mulyana
http://eueung.github.io/js/vuejs
JS CodeLabs | Attribution-ShareAlike CC BY-SA
1 / 16
Agenda
Quick Start
Build an App with Vue.JS
2 / 16
 Vue.JS - Quick Start
3 / 16
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="utf-8">
<title>Vue.JS</title>
<style></style>
</head>
<bodyonload="init()">
<divid="app">
{{message}}
</div>
<scriptsrc="https://cdn.jsdelivr.net/vue/latest/vue.js">
<scripttype="text/javascript">
functioninit(){
newVue({
el:'#app',
data:{
message:'HelloVue.js!'
}
});
}
</script>
</body></html>
Example #1
4 / 16
Example #2
 
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="utf-8">
<title>Vue.JS</title>
<style></style>
</head>
<bodyonload="init()">
<divid="app">
<p>{{message}}</p>
<inputv-model="message">
</div>
<scriptsrc="https://cdn.jsdelivr.net/vue/latest/vue.js">
<scripttype="text/javascript">
functioninit(){
newVue({
el:'#app',
data:{
message:'HelloVue.js!'
}
});
}
</script>
</body></html>
5 / 16
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="utf-8"><title>Vue.JS</title><style></style
</head>
<bodyonload="init()">
<divid="app">
<ul>
<liv-for="todointodos">
{{todo.text}}
</li>
</ul>
</div>
<scriptsrc="https://cdn.jsdelivr.net/vue/latest/vue.js">
<scripttype="text/javascript">
functioninit(){
newVue({
el:'#app',
data:{
todos:[
{text:'LearnJavaScript'},
{text:'LearnVue.js'},
{text:'BuildSomethingAwesome'}
]
}
});
}
</script>
</body></html>
Example #3
 
6 / 16
Example #4
 
<!DOCTYPEhtml>
<htmllang="en">
<head>
<metacharset="utf-8"><title>Vue.JS</title><style></style
</head>
<bodyonload="init()">
<divid="app">
<p>{{message}}</p>
<buttonv-on:click="reverseMessage">ReverseMessage</butto
</div>
<scriptsrc="https://cdn.jsdelivr.net/vue/latest/vue.js">
<scripttype="text/javascript">
functioninit(){
newVue({
el:'#app',
data:{
message:'HelloVue.js!'
},
methods:{
reverseMessage:function(){
this.message=this.message.split('').reverse().join
}
}
});
}
</script>
</body></html>
7 / 16
<!DOCTYPEhtml>
<htmllang="en">
<head><metacharset="utf-8"><title>Vue.JS</title><style></style
<bodyonload="init()">
<divid="app">
<inputv-model="newTodo"v-on:keyup.enter="addTodo">
<ul>
<liv-for="todointodos">
<span>{{todo.text}}</span>
<buttonv-on:click="removeTodo($index)">X</button>
</li>
</ul>
</div>
<scriptsrc="https://cdn.jsdelivr.net/vue/latest/vue.js">
<scripttype="text/javascript">
functioninit(){
newVue({
el:'#app',
data:{
newTodo:'',
todos:[{text:'Addsometodos'}]
},
methods:{
addTodo:function(){
vartext=this.newTodo.trim()
if(text){this.todos.push({text:text});this
},
removeTodo:function(index){this.todos.splice(index,
}});}
</script></body></html>
Example #5
 
8 / 16
 Build an App with Vue.JS
scotch.io
9 / 16
Case #1
<!doctypehtml>
<html>
<head>
<metacharset="utf-8">
<title>Vue</title>
<linkrel="stylesheet"href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
<style>
.form-control{
margin-bottom:10px;
}
</style>
</head>
<body>
<navclass="navbarnavbar-default">
<divclass="container-fluid">
<aclass="navbar-brand"><iclass="glyphiconglyphicon-bullhorn"
</div>
</nav>
...
</body>
<scriptsrc="https://cdn.jsdelivr.net/vue/latest/vue.js"></
<scriptsrc="https://cdn.jsdelivr.net/vue.resource/0.1.17/vue-resource.min.js"
<scriptsrc="vue-scotchio-1.js"></script>
</html>
vue-schotchio-1.html
<divclass="container"id="events">
<divclass="col-sm-6">
<divclass="panelpanel-default">
<divclass="panel-heading">
<h3>AddanEvent</h3>
</div>
<divclass="panel-body">
<div>
<inputclass="form-control"placeholder="EventName"
<tag-textareaclass="form-control"placeholder="Even
<inputtype="date"class="form-control"placeholder
<buttonclass="btnbtn-primary"v-on:click="addEvent
</div>
</div>
</div>
</div>
<divclass="col-sm-6">
<divclass="list-group">
<ahref="#"class="list-group-item"v-for="eventineven
<h4class="list-group-item-heading"><iclass="glyphico
<h5><iclass="glyphiconglyphicon-calendar"v-if="even
<pclass="list-group-item-text"v-if="event.descriptio
<buttonclass="btnbtn-xsbtn-danger"v-on:click="dele
</a>
</div>
</div>
</div>
10 / 16
Case #1
newVue({
el:'#events',
data:{
event:{name:'',description:'',date:''},
events:[]
},
ready:function(){
this.fetchEvents();
},
methods:{
...
}
});
vue-scotchio-1.js
methods:{
fetchEvents:function(){
varevents=[
{id:1,name:'TIFF',description:'TorontoInternati
{id:2,name:'TheMartianPremiere',description:
{id:3,name:'SXSW',description:'Music,filmandi
];
this.$set('events',events);
console.log(JSON.stringify(events));
},
addEvent:function(){
if(this.event.name){
this.events.push(this.event);
this.event={name:'',description:'',date:''};
}
},
deleteEvent:function(index){
if(confirm("Areyousureyouwanttodeletethisevent?"
this.events.$remove(index);
}
}
}
11 / 16
Case #1
12 / 16
Case #2
</body>
<scriptsrc="https://cdn.jsdelivr.net/vue/latest/vue.js"></
<scriptsrc="https://cdn.jsdelivr.net/vue.resource/0.1.17/vue-resource.min.js"
<scriptsrc="vue-scotchio-2.js"></script>
</html>
methods:{
fetchEvents:function(){
this.$http.get('vue-scotchio-2.json').success(function
this.$set('events',events);
}).error(function(error){
console.log(error);
});
},
addEvent:function(){
...
},
deleteEvent:function(index){
...
}
}
vue-scotchio-2.json
[
{
"id":1,
"name":"TIFF",
"description":"TorontoInternationalFilmFestival",
"date":"2015-09-10"
},
{
"id":2,
"name":"TheMartianPremiere",
"description":"TheMartiancomestotheatres.",
"date":"2015-10-02"
},
{
"id":3,
"name":"SXSW",
"description":"Music,filmandinteractivefestivalinAu
"date":"2016-03-11"
}
]
13 / 16
Case #2
14 / 16
References
1. Getting Started - vue.js
2. Build an App with Vue.js | Scotch
15 / 16

END
Eueung Mulyana
http://eueung.github.io/js/vuejs
JS CodeLabs | Attribution-ShareAlike CC BY-SA
16 / 16

More Related Content

PDF
Love at first Vue
PDF
Vue js and Vue Material
PDF
Vue js 大型專案架構
PDF
Vuejs for Angular developers
PDF
The Point of Vue - Intro to Vue.js
PDF
Why Vue.js?
PDF
Vue.js for beginners
PDF
An introduction to Vue.js
Love at first Vue
Vue js and Vue Material
Vue js 大型專案架構
Vuejs for Angular developers
The Point of Vue - Intro to Vue.js
Why Vue.js?
Vue.js for beginners
An introduction to Vue.js

What's hot (20)

PDF
PPT
Vue.js Getting Started
PDF
Vue JS Intro
PDF
VueJS Introduction
ODP
An Introduction to Vuejs
PDF
Modern frontend development with VueJs
PPTX
Vue 2.0 + Vuex Router & Vuex at Vue.js
PPTX
How to Build SPA with Vue Router 2.0
PDF
Room with a Vue - Introduction to Vue.js
PDF
Enjoy the vue.js
PDF
Vue.js is boring - and that's a good thing
PDF
VueJS: The Simple Revolution
PDF
Scalable Front-end Development with Vue.JS
PDF
Famo.us - New generation of HTML5 Web Application Framework
PDF
Building a Single Page Application with VueJS
PDF
Vue.js
PPTX
An introduction to Vue.js
PDF
Vue 淺談前端建置工具
PDF
introduction to Vue.js 3
Vue.js Getting Started
Vue JS Intro
VueJS Introduction
An Introduction to Vuejs
Modern frontend development with VueJs
Vue 2.0 + Vuex Router & Vuex at Vue.js
How to Build SPA with Vue Router 2.0
Room with a Vue - Introduction to Vue.js
Enjoy the vue.js
Vue.js is boring - and that's a good thing
VueJS: The Simple Revolution
Scalable Front-end Development with Vue.JS
Famo.us - New generation of HTML5 Web Application Framework
Building a Single Page Application with VueJS
Vue.js
An introduction to Vue.js
Vue 淺談前端建置工具
introduction to Vue.js 3
Ad

Similar to Javascript MVVM with Vue.JS (20)

PDF
Getting Started with Vue.js
PDF
Vue js 2.x
PPTX
An introduction to Vue.js
PDF
What is Vue.js in Software Development.docx.pdf
PPTX
Basics of Vue.js 2019
PPTX
Vue.JS Hello World
PPTX
Introduction to VueJS for begginers with examples | Namspace IT
PPTX
A New Vue for Web Development
PPTX
Introduction to Vue.js DevStaff Meetup 13.02
PPTX
Getting Started with Vuejs
PDF
Intro to vue.js
PDF
Why do JavaScript enthusiast think of Vue.js for building real-time web appli...
ODP
Web Development with VueJS : The Complete Guide
PDF
How to Build ToDo App with Vue 3 + TypeScript
PDF
Key Advantages of Vue.js in Web App Development.pdf
PPTX
Introduction to modern front-end with Vue.js
PPTX
Why Choose Vue.js For Web Development Projects.pptx
PPTX
Level up apps and websites with vue.js
PPTX
Level up apps and websites with vue.js
PPTX
[DevDay2019] Vue.js - By Nguyen Viet Cuong, Engineer at MTI Technology
Getting Started with Vue.js
Vue js 2.x
An introduction to Vue.js
What is Vue.js in Software Development.docx.pdf
Basics of Vue.js 2019
Vue.JS Hello World
Introduction to VueJS for begginers with examples | Namspace IT
A New Vue for Web Development
Introduction to Vue.js DevStaff Meetup 13.02
Getting Started with Vuejs
Intro to vue.js
Why do JavaScript enthusiast think of Vue.js for building real-time web appli...
Web Development with VueJS : The Complete Guide
How to Build ToDo App with Vue 3 + TypeScript
Key Advantages of Vue.js in Web App Development.pdf
Introduction to modern front-end with Vue.js
Why Choose Vue.js For Web Development Projects.pptx
Level up apps and websites with vue.js
Level up apps and websites with vue.js
[DevDay2019] Vue.js - By Nguyen Viet Cuong, Engineer at MTI Technology
Ad

More from Eueung Mulyana (20)

PDF
FGD Big Data
PDF
Hyper-Connectivity and Data Proliferation - Ecosystem Perspective
PDF
Industry 4.0 And Beyond The A.I* For Surviving A Tech-Accelerated World
PDF
Blockchain Introduction
PDF
Bringing Automation to the Classroom: A ChatOps-Based Approach
PDF
FinTech & Cryptocurrency Introduction
PDF
Open Source Networking Overview
PDF
ONOS SDN Controller - Clustering Tests & Experiments
PDF
Open stack pike-devstack-tutorial
PDF
Basic onos-tutorial
PDF
ONOS SDN Controller - Introduction
PDF
OpenDaylight SDN Controller - Introduction
PDF
Mininet Basics
PDF
Android Programming Basics
PDF
Cloud Computing: Overview and Examples
PDF
selected input/output - sensors and actuators
PDF
Connected Things, IoT and 5G
PDF
Connectivity for Local Sensors and Actuators Using nRF24L01+
PDF
NodeMCU with Blynk and Firebase
PDF
Trends and Enablers - Connected Services and Cloud Computing
FGD Big Data
Hyper-Connectivity and Data Proliferation - Ecosystem Perspective
Industry 4.0 And Beyond The A.I* For Surviving A Tech-Accelerated World
Blockchain Introduction
Bringing Automation to the Classroom: A ChatOps-Based Approach
FinTech & Cryptocurrency Introduction
Open Source Networking Overview
ONOS SDN Controller - Clustering Tests & Experiments
Open stack pike-devstack-tutorial
Basic onos-tutorial
ONOS SDN Controller - Introduction
OpenDaylight SDN Controller - Introduction
Mininet Basics
Android Programming Basics
Cloud Computing: Overview and Examples
selected input/output - sensors and actuators
Connected Things, IoT and 5G
Connectivity for Local Sensors and Actuators Using nRF24L01+
NodeMCU with Blynk and Firebase
Trends and Enablers - Connected Services and Cloud Computing

Recently uploaded (20)

PPTX
Generics jehfkhkshfhskjghkshhhhlshluhueheuhuhhlhkhk.pptx
PPTX
durere- in cancer tu ttresjjnklj gfrrjnrs mhugyfrd
PPTX
SEO Trends in 2025 | B3AITS - Bow & 3 Arrows IT Solutions
PPTX
ENCOR_Chapter_10 - OSPFv3 Attribution.pptx
PPTX
Crypto Recovery California Services.pptx
PDF
LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1
PDF
KIPER4D situs Exclusive Game dari server Star Gaming Asia
PDF
Centralized Business Email Management_ How Admin Controls Boost Efficiency & ...
PDF
The Internet -By the Numbers, Sri Lanka Edition
PDF
Decoding a Decade: 10 Years of Applied CTI Discipline
PPTX
ENCOR_Chapter_11 - ‌BGP implementation.pptx
PDF
“Google Algorithm Updates in 2025 Guide”
PPTX
EthicalHack{aksdladlsfsamnookfmnakoasjd}.pptx
PPTX
CSharp_Syntax_Basics.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxx
PPTX
introduction about ICD -10 & ICD-11 ppt.pptx
PPTX
QR Codes Qr codecodecodecodecocodedecodecode
PPTX
AI ad its imp i military life read it ag
PDF
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
PDF
Elements Of Poetry PowerPoint With Sources
PPTX
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx
Generics jehfkhkshfhskjghkshhhhlshluhueheuhuhhlhkhk.pptx
durere- in cancer tu ttresjjnklj gfrrjnrs mhugyfrd
SEO Trends in 2025 | B3AITS - Bow & 3 Arrows IT Solutions
ENCOR_Chapter_10 - OSPFv3 Attribution.pptx
Crypto Recovery California Services.pptx
LABUAN4D EXCLUSIVE SERVER STAR GAMING ASIA NO.1
KIPER4D situs Exclusive Game dari server Star Gaming Asia
Centralized Business Email Management_ How Admin Controls Boost Efficiency & ...
The Internet -By the Numbers, Sri Lanka Edition
Decoding a Decade: 10 Years of Applied CTI Discipline
ENCOR_Chapter_11 - ‌BGP implementation.pptx
“Google Algorithm Updates in 2025 Guide”
EthicalHack{aksdladlsfsamnookfmnakoasjd}.pptx
CSharp_Syntax_Basics.pptxxxxxxxxxxxxxxxxxxxxxxxxxxxx
introduction about ICD -10 & ICD-11 ppt.pptx
QR Codes Qr codecodecodecodecocodedecodecode
AI ad its imp i military life read it ag
APNIC Update, presented at PHNOG 2025 by Shane Hermoso
Elements Of Poetry PowerPoint With Sources
LESSON-2-Roles-of-ICT-in-Teaching-for-learning_123922 (1).pptx

Javascript MVVM with Vue.JS