SlideShare a Scribd company logo
Vue.JSThe progressive JavaScript Framework
Yet Another JS Framework
Or Is it?
David Ličen, 

Freelance Front-End Developer


Twitter: @davision

Blog: davidlicen.com
VueJS Introduction
The facts
The Founder
Evan You
• Previously worked as a Creative
Technologist at Google
• Core Dev at Meteor
• From 2016 working full-time on
Vue.JS framework.



—> patreon.com/evanyou
History
• Started in late 2013
• First release Feb. 2014 (v0.6)
• v1.0.0 Evangelion Oct. 2015
• Latest release v2.3.3
VueJS Introduction
VueJS gets into in Laravel 5.3
Optional
Today (on 24.5.2017)
vs. AngularJS
vs. React
Today (on 24.5.2017)
vs. Ruby ;)
Today (on 24.5.2017)
562K downloads/month
Who is using it?
• GitLab 

https://about.gitlab.com/2016/10/20/why-we-chose-vue/
• Weex 

https://weex.apache.org/ Maintained by Alibaba Group
• Baidu

Chinese search engine
How does it work?
Technical stuff
How it works?
• Inspired by Model–view–
viewmodel (MVVM)
architectural pattern
• Uses Declarative Rendering
• Dependency tracking system
with getter/setters
The Vue Instance
• Vue Constructor function
• Properties and Methods (data / events)
• Instance Lifecycle Hooks
var vm = new Vue({
// options
})
The Vue Instance Lifecycle
VueJS Introduction
var vm = new Vue({
data: {
a: 1
},
created: function () {
// `this` points to the vm instance
console.log('a is: ' + this.a)
}
})
vm.$watch('a', function (newVal, oldVal) {
// this callback will be called when `vm.a` changes
})
Let see some code examples
Practical stuff
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vue.js</title>
<script src="vue.js"></script>
</head>
<body>
<div id="selector">
<h1>{{ message }}</h1>
</div>
</body>
</html>

// Define a plain JSON
// object to hold the data
var data = {
message: "Hello"
};
// Instantiate Vue on an element
new Vue ({
el: "#selector",
data: data
})
// Works since getters/setters
// are now proxied
data.message = "Hi";
Directives
v-bind
<!-- full syntax -->
<a v-bind:href="url"></a>
<!-- shorthand -->
<a :href="url"></a>

v-on
<!-- full syntax -->
<a v-on:click="doSomething"></a>
<!-- shorthand -->
<a @click="doSomething"></a>
<div :class="{
'active': isActive,
'text-danger': HasError }
">
</div>

data: {
isActive: true,
hasError: false
}
Binding HTML Classes
<div id="events">
<button v-on:click="counter += 1”>
Add +1</button>
<p>You clicked {{ counter }}</p>
<button @click=“say(‘what')">
Say what</button>
</div>

new Vue ({
el: '#events',
data: {
counter: 0
},
methods: {
say: function (message) {
alert(message)
}
}
})
Event handling
<div v-if="type === 'A'"> A </div>
<div v-else-if="type === 'B'"> B </div>
<div v-else-if="type === 'C'"> C </div>
<div v-else> Not A/B/C </div>
Conditional Rendering
<ul id=“list">
<li v-for="(item, index) in items">
{{ parentMessage }} -
{{ index }} -
{{ item.message }}
</li>
</ul>

new Vue({
el: '#list',
data: {
parentMessage: ‘Parent',
items: [
{ message: 'Foo' },
{ message: 'Bar' }
]
}
})
Loops
<!-- the click event's propagation will be stopped -->
<a @click.stop="oThis"></a>
<!-- the submit event will no longer reload the page -->
<form @submit.prevent="onSubmit"></form>
<!-- modifiers can be chained -->
<a @click.stop.prevent="doThat"></a>
<!-- also available .tab, .delete, .esc, .space, ...-->
<input @keyup.enter="submit">
Event & Key Modifiers
Etc..
https://vuejs.org/v2/guide/
Single File Components
Introducing
Made by Webpack (or Browserify)
Now we get
• Complete syntax highlighting
• CommonJS modules
• Component-scoped CSS
• Use of preprocessors (Pug, Babel, Stylus, Sass…)
VueJS Introduction
new Vue ({
el: "#selector",
data: {
message: 'Hello'
}
})

export default {
data () {
return {
message: 'Hello'
}
}
}
Mind the difference
Let’s do some 💩
and build our first VueJS app
npm install --global vue-cli
vue init webpack my-project
? Project name vue-webpack
? Project description A Vue.js project
? Author davidlicen <david@artnetik.si>
? Vue build standalone
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Airbnb
? Setup unit tests with Karma + Mocha? No
? Setup e2e tests with Nightwatch? No
We’re packed!
cd my-project
npm install
npm run dev
yarn anyone?
VueJS Introduction
VueJS Introduction
Dev tools ⚒
VueJS Introduction
Doubts 🤔
Some say…
• Vue initiated by a single developer
• The community is not yet as large as the ones of
Angular or React
• Currently, there’s not so many libraries for Vue…
Sauce!
github.com/vuejs/awesome-vue
Sauce!
vuejs.org
WROCŁAW, POLAND • JUNE 21-23, 2017
Thank you!

More Related Content

ODP
An Introduction to Vuejs
PDF
VueJS: The Simple Revolution
PPT
Vue.js Getting Started
PDF
introduction to Vue.js 3
PDF
Intro to vue.js
PDF
ODP
Basics of VueJS
PDF
Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...
An Introduction to Vuejs
VueJS: The Simple Revolution
Vue.js Getting Started
introduction to Vue.js 3
Intro to vue.js
Basics of VueJS
Angular vs React vs Vue | Javascript Frameworks Comparison | Which One You Sh...

What's hot (20)

PDF
An introduction to Vue.js
PDF
Vue.js for beginners
PDF
The Point of Vue - Intro to Vue.js
PPTX
An introduction to Vue.js
PDF
Why Vue.js?
PDF
Vue, vue router, vuex
PPTX
Vue js for beginner
PPTX
Express js
PPTX
Maven ppt
PPT
Maven Introduction
PPTX
Basics of Vue.js 2019
PDF
NodeJS for Beginner
PDF
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
PPTX
Introduction to Node.js
PPTX
Spring Boot and REST API
PDF
Introduction to VueJS & Vuex
PPTX
ReactJS presentation.pptx
PPTX
Its time to React.js
PPT
Maven Overview
PPTX
learn what React JS is & why we should use React JS .
An introduction to Vue.js
Vue.js for beginners
The Point of Vue - Intro to Vue.js
An introduction to Vue.js
Why Vue.js?
Vue, vue router, vuex
Vue js for beginner
Express js
Maven ppt
Maven Introduction
Basics of Vue.js 2019
NodeJS for Beginner
Node.js Express Tutorial | Node.js Tutorial For Beginners | Node.js + Expres...
Introduction to Node.js
Spring Boot and REST API
Introduction to VueJS & Vuex
ReactJS presentation.pptx
Its time to React.js
Maven Overview
learn what React JS is & why we should use React JS .
Ad

Similar to VueJS Introduction (20)

PDF
Vue js 2.x
PPTX
An introduction to Vue.js
PDF
Drupal point of vue
PDF
Vue.js - An Introduction
PDF
Getting Started with Vue.js
PDF
Vue JS Intro
PPTX
Introduction to Vue.js DevStaff Meetup 13.02
PDF
Vue.js
PDF
Meet VueJs
PDF
ITB2019 ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 V...
PPTX
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
PPTX
Introduction to VueJS for begginers with examples | Namspace IT
PDF
Vue js and Vue Material
PPTX
Membangun Moderen UI dengan Vue.js
PDF
Quasar Framework Introduction for C++ develpoers
PPTX
Why Choose Vue.js For Web Development Projects.pptx
PPTX
Vue.js Use Cases
PPTX
Getting started with Vue.js - CodeMash 2020
PPTX
Level up apps and websites with vue.js
PPTX
Level up apps and websites with vue.js
Vue js 2.x
An introduction to Vue.js
Drupal point of vue
Vue.js - An Introduction
Getting Started with Vue.js
Vue JS Intro
Introduction to Vue.js DevStaff Meetup 13.02
Vue.js
Meet VueJs
ITB2019 ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 V...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
Introduction to VueJS for begginers with examples | Namspace IT
Vue js and Vue Material
Membangun Moderen UI dengan Vue.js
Quasar Framework Introduction for C++ develpoers
Why Choose Vue.js For Web Development Projects.pptx
Vue.js Use Cases
Getting started with Vue.js - CodeMash 2020
Level up apps and websites with vue.js
Level up apps and websites with vue.js
Ad

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PPT
Introduction Database Management System for Course Database
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PPTX
history of c programming in notes for students .pptx
PPTX
Essential Infomation Tech presentation.pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPT
JAVA ppt tutorial basics to learn java programming
PPTX
Transform Your Business with a Software ERP System
PDF
Digital Strategies for Manufacturing Companies
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
System and Network Administration Chapter 2
PDF
AI in Product Development-omnex systems
PPTX
L1 - Introduction to python Backend.pptx
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Odoo POS Development Services by CandidRoot Solutions
Introduction Database Management System for Course Database
Understanding Forklifts - TECH EHS Solution
Design an Analysis of Algorithms I-SECS-1021-03
history of c programming in notes for students .pptx
Essential Infomation Tech presentation.pptx
Operating system designcfffgfgggggggvggggggggg
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
How to Migrate SBCGlobal Email to Yahoo Easily
Which alternative to Crystal Reports is best for small or large businesses.pdf
JAVA ppt tutorial basics to learn java programming
Transform Your Business with a Software ERP System
Digital Strategies for Manufacturing Companies
Upgrade and Innovation Strategies for SAP ERP Customers
Wondershare Filmora 15 Crack With Activation Key [2025
System and Network Administration Chapter 2
AI in Product Development-omnex systems
L1 - Introduction to python Backend.pptx
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...

VueJS Introduction