SlideShare uma empresa Scribd logo
1 de 23
Baixar para ler offline
1
WHY VUE.JS?
“The Progressive JavaScript Framework”
Introduction to Vue.js
Jonathan Goode
2 . 1
WHAT IS VUE.JS?
Vue (pronounced /vjuː/, like view) is a progressive framework for
building user interfaces
The core library is focused on the view layer only
The library was created by who released v1 on 26
October 2015
The project is permanently backed by pledgers on
$7,572 (~£6,145) per month
Evan You
Patreon.com
2 . 2
WHO USES VUE?
Rank Site Detections
1st laravel.com 49,476
2nd laracasts.com 29,185
3rd gitlab.com 26,522
8th codeship.com 3,069
Detections by Wappalyzer in the last 7 days
INTERNATION ADOPTION
China: Alibaba and Baidu, Japan: Nintendo and UK:
Sainsbury's
2 . 3
USING VUE
Getting started with Vue.js is extremely easy
Its source code is very readable, and the documentation is the
only tutorial you will need
You don't need external libraries
You can use it with or without jQuery
You won't even need to install any plugins, though many are
available
2 . 4
USING VUE
Hooking Vue up to existing code is very straightforward
Vue makes no assumptions about your code
It really only assumes that your data will change
Real-life usage is as simple as the docs demonstrate it to
be
3 . 1
PERFORMANCE
Vue.js 2.0 was released on Sep 30 - current release is v2.0.3 - 16kb min+gzip
Based on , lower is better3rd party benchmark
3 . 2
VUE.JS 2.0
The rendering layer has been rewritten using a light-weight
Virtual DOM implementation forked from .
On top of that, Vue's template compiler is able to apply some
smart optimizations during compilation, such as analyzing and
hoisting static sub trees to avoid unnecessary diffing on re-
render.
The new rendering layer provides significant performance
improvements compared to v1, and makes Vue 2.0 one of the
fastest frameworks.
In addition, it requires minimal effort in terms of optimization
because Vue's reactivity system is able to precisely determine
components that need to be re-rendered in a large and complex
component tree.
snabbdom
4 . 1
VUE AND CONDITIONAL LOGIC
V‐IF / V‐ELSE
// JavaScript 
var example = new Vue({ 
    el:   '.example', 
    data: { cond: (1 > 0), }, // true 
}); 
<div class="example"> 
    <div v­if="cond">Yes</div> 
    <div v­else>No</div> 
</div>
4 . 2
V‐SHOW
// JavaScript 
var example = new Vue({ 
    el:   '.example', 
    data: { cond: (1 > 0), }, // true 
}); 
<!­­ HTML ­­> 
<div class="example"> 
    <div v­show="cond">Yes</div> 
    <div v­show="!cond">No</div> 
</div>
4 . 3
WITH A TEMPLATE
<!­­ HTML ­­> 
<template v­if="cond"> 
    <h1>Title</h1> 
    <p>Paragraph 1</p> 
    <p>Paragraph 2</p> 
</template> 
=
<!­­ HTML ­­> 
<h1>Title</h1> 
<p>Paragraph 1</p> 
<p>Paragraph 2</p> 
4 . 4
V‐FOR
// JavaScript 
var example = new Vue({ 
    el:   '.example', 
    data: { items: { message: 'Foo' }, { message: 'Bar' }, }, 
}); 
<!­­ HTML ­­> 
<ul class="example"> 
    <li v­for="item in items">{{ item.message }}</li> 
</ul>
4 . 5
V‐FOR USING AN OBJECT
// JavaScript 
var example = new Vue({ 
    el:   '.example', 
    data: { object: FirstName: 'Jonathan', LastName: 'Goode', Age: 30, }, 
}); 
<!­­ HTML ­­> 
<ul class="example"> 
    <li v­for="value in object">{{ $key }}: {{ value }}</li> 
</ul>
4 . 6
V‐FOR USING A RANGE
// JavaScript 
var example = new Vue({ 
    el: '.example', 
}); 
<!­­ HTML ­­> 
<ul class="example"> 
    <li v­for="n in 10">{{ n }}</li> 
</ul>
4 . 7
V‐FOR USING A FILTER
What will the output
be?
// JavaScript 
var example = new Vue({ 
    el:   '.example', 
    data: { array: [2, 4, 6, 8, 10,], }, 
}); 
<!­­ HTML ­­> 
<ul class="example"> 
    <li v­for="n in array | limitBy 3">{{ n }}</li> 
</ul>
5
VUE AND EVENT HANDLING
<!­­ HTML ­­> 
<a v­on:click="doSomething">Link</a> 
<a @click="doSomething">Link</a><!­­ shorthand syntax ­­> 
// Modifiers 
<!­­ with event.preventDefault() ­­> 
<a @click.prevent="doSomething">Link</a> 
<!­­ with event.stopPropagation() ­­> 
<a @click.stop="doSomething">Link</a> 
<!­­ with event.preventDefault() and event.stopPropagation() ­­> 
<a @click.stop.prevent="doSomething">Link</a> 
6
VUE AND LARAVEL
// JavaScript ­ for Laravel (requires jQuery) 
Vue.http.headers.common['X­CSRF­TOKEN'] = 
$('meta[name="csrf­token"]').attr('content'); 
// PHP ­ escape Blade syntax 
@{{ item.message }}
(Recommended Combination)
7
INSTALLING VUE
package.json
"dependencies": { 
  "vue": "*" 
} 
Run
npm
$ npm install 
8
VUE EXPLAINED
HELLO WORLD EXAMPLE ⇲
The data for the view goes in an object called data
This can get there and look however you want
Functions are written as callbacks that go into a methods
object
They can do or return whatever you want
var journal = new Vue({ 
    el: '.journal', 
    data: { message: 'Hello World' }, methods: { }, 
});
<div class="journal"> 
    <input type="text" v­model="message"><pre>{{ message | json }}</pre> 
</div>
9
INPUT COUNTER EXAMPLE ⇲
// JavaScript 
new Vue({ 
    el:      '.question­text', 
    data:    { questions: [{ question_text: '', }], }, 
    methods: { getLength: function(key){ 
        return mb_strlen(this.questions[0][key]); 
    }, }, 
});
<!­­ HTML ­­> 
<small v­bind:class="{ 'red': getLength('question_text') > 499 }" 
       v­cloak class="pull­right">Characters: 
    <span v­bind:class="{'text­embolden': getLength('question_text') > 500}"
        @{{ getLength('question_text') }} 
    </span> / 500 
</small>
10 . 1
VUE DIRECTIVES
Custom directives provide a mechanism for mapping data changes to arbitrary DOM behaviour
"seiyria‐bootstrap‐slider": "7.0.3"
Vue.directive('slider', { 
    bind: function(){ /* do preparation work */ 
        var vm  = this.vm; 
        var key = this.expression; 
        var slider = $(this.el).slider() 
            .on('change', function(ev){ vm.$set(key, ev.value.newValue); })
            .data('slider'); 
    }, 
    update: function(val){ /* do something based on initial/updated value */
        val = parseFloat(val); 
        if(!isNaN(val)){ $(this.el).slider('setValue', val); } 
    }, 
    unbind: function(){ /* do clean up work */ }, 
});
10 . 2
SLIDER EXAMPLE ⇲
// JavaScript 
new Vue({ 
    el:   '.form­alerts', 
    data: alerts: [{ id: '', alert_message: '', alert_time: '' }], 
});
<!­­ HTML ­­> 
<template v­for="alert in alerts"> 
    <input 
        class="form­control station­alert­time" 
        name="station_alert_time" 
        type="text" 
        v­slider="alerts[$index].alert_time" 
        v­model="alerts[$index].alert_time" 
        data­slider­min="0.5" 
        data­slider­max="5" 
        data­slider­step="0.5" 
        data­slider­value="2.5"> 
</template>
11
VUE PLUGINS
Provides services for making web requests and handling responses using an
XMLHttpRequest or JSONP
The HTTP client for Vue.js
Centralised State Management for Vue.js
Similar to (Re)Flux for React
Bootstrap components built with Vue.js
No jQuery, bootstrap.js, or any third party plugins required
VueResource
VueRouter
VueX
VueStrap
12
MORE RESOURCES
https://vuejs.org
https://github.com/vuejs/vue
Vue.js DevTools - Chrome
Extension

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

Vue, vue router, vuex
Vue, vue router, vuexVue, vue router, vuex
Vue, vue router, vuex
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
 
Intro to vue.js
Intro to vue.jsIntro to vue.js
Intro to vue.js
 
Vue.js
Vue.jsVue.js
Vue.js
 
An Introduction to Vuejs
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to Vuejs
 
Love at first Vue
Love at first VueLove at first Vue
Love at first Vue
 
Vue JS Intro
Vue JS IntroVue JS Intro
Vue JS Intro
 
Reactjs
ReactjsReactjs
Reactjs
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
Introduction to ReactJS
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
 
Node.js Express
Node.js  ExpressNode.js  Express
Node.js Express
 
State manager in Vue.js, from zero to Vuex
State manager in Vue.js, from zero to VuexState manager in Vue.js, from zero to Vuex
State manager in Vue.js, from zero to Vuex
 
Intro to React
Intro to ReactIntro to React
Intro to React
 
Basic Concept of Node.js & NPM
Basic Concept of Node.js & NPMBasic Concept of Node.js & NPM
Basic Concept of Node.js & NPM
 
react-slides.pptx
react-slides.pptxreact-slides.pptx
react-slides.pptx
 
ReactJS presentation
ReactJS presentationReactJS presentation
ReactJS presentation
 
Spring Framework - MVC
Spring Framework - MVCSpring Framework - MVC
Spring Framework - MVC
 
React js programming concept
React js programming conceptReact js programming concept
React js programming concept
 
NodeJS for Beginner
NodeJS for BeginnerNodeJS for Beginner
NodeJS for Beginner
 
React workshop
React workshopReact workshop
React workshop
 

Destaque

Progressive Framework Vue.js 2.0
Progressive Framework Vue.js 2.0Progressive Framework Vue.js 2.0
Progressive Framework Vue.js 2.0Toshiro Shimizu
 
Vue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.jsVue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.jsTakuya Tejima
 
Vue js and Vue Material
Vue js and Vue MaterialVue js and Vue Material
Vue js and Vue MaterialEueung Mulyana
 
Vue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingVue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingJoonas Lehtonen
 
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.jsTechExeter
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JSEueung Mulyana
 
Vue.js - o framework progressivo
Vue.js - o framework progressivoVue.js - o framework progressivo
Vue.js - o framework progressivoVinicius Reis
 
Making Turbolinks work with Vue.js: Fast server-generated pages with reactive...
Making Turbolinks work with Vue.js: Fast server-generated pages with reactive...Making Turbolinks work with Vue.js: Fast server-generated pages with reactive...
Making Turbolinks work with Vue.js: Fast server-generated pages with reactive...pascallaliberte
 
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]Kuro Hsu
 
Membangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsMembangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsFroyo Framework
 
XebiCon'16 : Angular2, React, Vue.js - Bien choisir son framework Front-End. ...
XebiCon'16 : Angular2, React, Vue.js - Bien choisir son framework Front-End. ...XebiCon'16 : Angular2, React, Vue.js - Bien choisir son framework Front-End. ...
XebiCon'16 : Angular2, React, Vue.js - Bien choisir son framework Front-End. ...Publicis Sapient Engineering
 
VueJS - Uma alternativa elegante
VueJS - Uma alternativa eleganteVueJS - Uma alternativa elegante
VueJS - Uma alternativa eleganteJonathan Bijos
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具andyyou
 
Vue.js
Vue.jsVue.js
Vue.jsBADR
 

Destaque (20)

Progressive Framework Vue.js 2.0
Progressive Framework Vue.js 2.0Progressive Framework Vue.js 2.0
Progressive Framework Vue.js 2.0
 
Vue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.jsVue 2.0 + Vuex Router & Vuex at Vue.js
Vue 2.0 + Vuex Router & Vuex at Vue.js
 
Vue js and Vue Material
Vue js and Vue MaterialVue js and Vue Material
Vue js and Vue Material
 
Vue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thingVue.js is boring - and that's a good thing
Vue.js is boring - and that's a good thing
 
Enjoy the vue.js
Enjoy the vue.jsEnjoy the vue.js
Enjoy the vue.js
 
Vue.js
Vue.jsVue.js
Vue.js
 
Javascript MVVM with Vue.JS
Javascript MVVM with Vue.JSJavascript MVVM with Vue.JS
Javascript MVVM with Vue.JS
 
Vue.js
Vue.jsVue.js
Vue.js
 
Vue.js - o framework progressivo
Vue.js - o framework progressivoVue.js - o framework progressivo
Vue.js - o framework progressivo
 
Making Turbolinks work with Vue.js: Fast server-generated pages with reactive...
Making Turbolinks work with Vue.js: Fast server-generated pages with reactive...Making Turbolinks work with Vue.js: Fast server-generated pages with reactive...
Making Turbolinks work with Vue.js: Fast server-generated pages with reactive...
 
第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]第一次用 Vue.js 就愛上 [改]
第一次用 Vue.js 就愛上 [改]
 
Dojo vue.js
Dojo vue.jsDojo vue.js
Dojo vue.js
 
Desmistificando o PostCSS
Desmistificando o PostCSSDesmistificando o PostCSS
Desmistificando o PostCSS
 
Membangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsMembangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.js
 
How tovuejs
How tovuejsHow tovuejs
How tovuejs
 
XebiCon'16 : Angular2, React, Vue.js - Bien choisir son framework Front-End. ...
XebiCon'16 : Angular2, React, Vue.js - Bien choisir son framework Front-End. ...XebiCon'16 : Angular2, React, Vue.js - Bien choisir son framework Front-End. ...
XebiCon'16 : Angular2, React, Vue.js - Bien choisir son framework Front-End. ...
 
VueJS - Uma alternativa elegante
VueJS - Uma alternativa eleganteVueJS - Uma alternativa elegante
VueJS - Uma alternativa elegante
 
Vue 淺談前端建置工具
Vue 淺談前端建置工具Vue 淺談前端建置工具
Vue 淺談前端建置工具
 
GraphQL
GraphQLGraphQL
GraphQL
 
Vue.js
Vue.jsVue.js
Vue.js
 

Semelhante a Why Vue.js?

Vue js & vue cli 3 plugins to boost up the performance of your application
Vue js & vue cli 3 plugins to boost up the performance of your applicationVue js & vue cli 3 plugins to boost up the performance of your application
Vue js & vue cli 3 plugins to boost up the performance of your applicationKaty Slemon
 
Between a SPA and a JAMstack: Building Web Sites with Nuxt/Vue, Strapi and wh...
Between a SPA and a JAMstack: Building Web Sites with Nuxt/Vue, Strapi and wh...Between a SPA and a JAMstack: Building Web Sites with Nuxt/Vue, Strapi and wh...
Between a SPA and a JAMstack: Building Web Sites with Nuxt/Vue, Strapi and wh...Adam Khan
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vueDavid Ličen
 
41 best vue component libraries to archive for 2021
41 best vue component libraries to archive for 202141 best vue component libraries to archive for 2021
41 best vue component libraries to archive for 2021Katy Slemon
 
Why do JavaScript enthusiast think of Vue.js for building real-time web appli...
Why do JavaScript enthusiast think of Vue.js for building real-time web appli...Why do JavaScript enthusiast think of Vue.js for building real-time web appli...
Why do JavaScript enthusiast think of Vue.js for building real-time web appli...Katy Slemon
 
What is Vue.js in Software Development.docx.pdf
What is Vue.js in Software Development.docx.pdfWhat is Vue.js in Software Development.docx.pdf
What is Vue.js in Software Development.docx.pdfMPIRIC Software
 
Seven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseSeven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseMatt Raible
 
235042632 super-shop-ee
235042632 super-shop-ee235042632 super-shop-ee
235042632 super-shop-eehomeworkping3
 
Why Choose Vue.js For Web Development Projects.pptx
Why Choose Vue.js For Web Development Projects.pptxWhy Choose Vue.js For Web Development Projects.pptx
Why Choose Vue.js For Web Development Projects.pptxScala Code
 
React vs. vue which framework to select and when
React vs. vue  which framework to select and when React vs. vue  which framework to select and when
React vs. vue which framework to select and when MoonTechnolabsPvtLtd
 
Key Advantages of Vue.js in Web App Development.pdf
Key Advantages of Vue.js in Web App Development.pdfKey Advantages of Vue.js in Web App Development.pdf
Key Advantages of Vue.js in Web App Development.pdfWDP Technologies
 
Benefits of vue.js technology for business
Benefits of vue.js technology for businessBenefits of vue.js technology for business
Benefits of vue.js technology for business9 series
 
Netbeans 6.1 Talk
Netbeans 6.1 TalkNetbeans 6.1 Talk
Netbeans 6.1 TalkAngad Singh
 
React vs. vue which framework to select and when
React vs. vue  which framework to select and when React vs. vue  which framework to select and when
React vs. vue which framework to select and when Moon Technolabs Pvt. Ltd.
 
Is Vue catching up with React.pdf
Is Vue catching up with React.pdfIs Vue catching up with React.pdf
Is Vue catching up with React.pdfMindfire LLC
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...Gavin Pickin
 
Creating, debugging and deploying extension packages for Microsoft Visual Stu...
Creating, debugging and deploying extension packages for Microsoft Visual Stu...Creating, debugging and deploying extension packages for Microsoft Visual Stu...
Creating, debugging and deploying extension packages for Microsoft Visual Stu...PVS-Studio
 

Semelhante a Why Vue.js? (20)

Vue js & vue cli 3 plugins to boost up the performance of your application
Vue js & vue cli 3 plugins to boost up the performance of your applicationVue js & vue cli 3 plugins to boost up the performance of your application
Vue js & vue cli 3 plugins to boost up the performance of your application
 
Between a SPA and a JAMstack: Building Web Sites with Nuxt/Vue, Strapi and wh...
Between a SPA and a JAMstack: Building Web Sites with Nuxt/Vue, Strapi and wh...Between a SPA and a JAMstack: Building Web Sites with Nuxt/Vue, Strapi and wh...
Between a SPA and a JAMstack: Building Web Sites with Nuxt/Vue, Strapi and wh...
 
Drupal point of vue
Drupal point of vueDrupal point of vue
Drupal point of vue
 
41 best vue component libraries to archive for 2021
41 best vue component libraries to archive for 202141 best vue component libraries to archive for 2021
41 best vue component libraries to archive for 2021
 
Why do JavaScript enthusiast think of Vue.js for building real-time web appli...
Why do JavaScript enthusiast think of Vue.js for building real-time web appli...Why do JavaScript enthusiast think of Vue.js for building real-time web appli...
Why do JavaScript enthusiast think of Vue.js for building real-time web appli...
 
What is Vue.js in Software Development.docx.pdf
What is Vue.js in Software Development.docx.pdfWhat is Vue.js in Software Development.docx.pdf
What is Vue.js in Software Development.docx.pdf
 
Seven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuseSeven Simple Reasons to Use AppFuse
Seven Simple Reasons to Use AppFuse
 
235042632 super-shop-ee
235042632 super-shop-ee235042632 super-shop-ee
235042632 super-shop-ee
 
Why Choose Vue.js For Web Development Projects.pptx
Why Choose Vue.js For Web Development Projects.pptxWhy Choose Vue.js For Web Development Projects.pptx
Why Choose Vue.js For Web Development Projects.pptx
 
React vs. vue which framework to select and when
React vs. vue  which framework to select and when React vs. vue  which framework to select and when
React vs. vue which framework to select and when
 
Key Advantages of Vue.js in Web App Development.pdf
Key Advantages of Vue.js in Web App Development.pdfKey Advantages of Vue.js in Web App Development.pdf
Key Advantages of Vue.js in Web App Development.pdf
 
Benefits of vue.js technology for business
Benefits of vue.js technology for businessBenefits of vue.js technology for business
Benefits of vue.js technology for business
 
learning react
learning reactlearning react
learning react
 
Netbeans 6.1 Talk
Netbeans 6.1 TalkNetbeans 6.1 Talk
Netbeans 6.1 Talk
 
React vs. vue which framework to select and when
React vs. vue  which framework to select and when React vs. vue  which framework to select and when
React vs. vue which framework to select and when
 
Learn react-js
Learn react-jsLearn react-js
Learn react-js
 
Is Vue catching up with React.pdf
Is Vue catching up with React.pdfIs Vue catching up with React.pdf
Is Vue catching up with React.pdf
 
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
ColdBox APIs + VueJS - powering Mobile, Desktop and Web Apps with 1 VueJS cod...
 
Asp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdfAsp.net Vs Vue.js.pdf
Asp.net Vs Vue.js.pdf
 
Creating, debugging and deploying extension packages for Microsoft Visual Stu...
Creating, debugging and deploying extension packages for Microsoft Visual Stu...Creating, debugging and deploying extension packages for Microsoft Visual Stu...
Creating, debugging and deploying extension packages for Microsoft Visual Stu...
 

Último

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfkalichargn70th171
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfonteinmasabamasaba
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Bert Jan Schrijver
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...masabamasaba
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech studentsHimanshiGarg82
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park masabamasaba
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionOnePlan Solutions
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnAmarnathKambale
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareJim McKeeth
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...Jittipong Loespradit
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in sowetomasabamasaba
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is insideshinachiaurasa2
 
tonesoftg
tonesoftgtonesoftg
tonesoftglanshi9
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdfPearlKirahMaeRagusta1
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyviewmasabamasaba
 

Último (20)

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdfPayment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
Payment Gateway Testing Simplified_ A Step-by-Step Guide for Beginners.pdf
 
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
%in kaalfontein+277-882-255-28 abortion pills for sale in kaalfontein
 
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
Devoxx UK 2024 - Going serverless with Quarkus, GraalVM native images and AWS...
 
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital TransformationWSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
WSO2Con2024 - WSO2's IAM Vision: Identity-Led Digital Transformation
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park %in kempton park+277-882-255-28 abortion pills for sale in kempton park
%in kempton park+277-882-255-28 abortion pills for sale in kempton park
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) SolutionIntroducing Microsoft’s new Enterprise Work Management (EWM) Solution
Introducing Microsoft’s new Enterprise Work Management (EWM) Solution
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
tonesoftg
tonesoftgtonesoftg
tonesoftg
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Define the academic and professional writing..pdf
Define the academic and professional writing..pdfDefine the academic and professional writing..pdf
Define the academic and professional writing..pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
%in Hazyview+277-882-255-28 abortion pills for sale in Hazyview
 

Why Vue.js?

  • 1. 1 WHY VUE.JS? “The Progressive JavaScript Framework” Introduction to Vue.js Jonathan Goode
  • 2. 2 . 1 WHAT IS VUE.JS? Vue (pronounced /vjuː/, like view) is a progressive framework for building user interfaces The core library is focused on the view layer only The library was created by who released v1 on 26 October 2015 The project is permanently backed by pledgers on $7,572 (~£6,145) per month Evan You Patreon.com
  • 3. 2 . 2 WHO USES VUE? Rank Site Detections 1st laravel.com 49,476 2nd laracasts.com 29,185 3rd gitlab.com 26,522 8th codeship.com 3,069 Detections by Wappalyzer in the last 7 days INTERNATION ADOPTION China: Alibaba and Baidu, Japan: Nintendo and UK: Sainsbury's
  • 4. 2 . 3 USING VUE Getting started with Vue.js is extremely easy Its source code is very readable, and the documentation is the only tutorial you will need You don't need external libraries You can use it with or without jQuery You won't even need to install any plugins, though many are available
  • 5. 2 . 4 USING VUE Hooking Vue up to existing code is very straightforward Vue makes no assumptions about your code It really only assumes that your data will change Real-life usage is as simple as the docs demonstrate it to be
  • 6. 3 . 1 PERFORMANCE Vue.js 2.0 was released on Sep 30 - current release is v2.0.3 - 16kb min+gzip Based on , lower is better3rd party benchmark
  • 7. 3 . 2 VUE.JS 2.0 The rendering layer has been rewritten using a light-weight Virtual DOM implementation forked from . On top of that, Vue's template compiler is able to apply some smart optimizations during compilation, such as analyzing and hoisting static sub trees to avoid unnecessary diffing on re- render. The new rendering layer provides significant performance improvements compared to v1, and makes Vue 2.0 one of the fastest frameworks. In addition, it requires minimal effort in terms of optimization because Vue's reactivity system is able to precisely determine components that need to be re-rendered in a large and complex component tree. snabbdom
  • 8. 4 . 1 VUE AND CONDITIONAL LOGIC V‐IF / V‐ELSE // JavaScript  var example = new Vue({      el:   '.example',      data: { cond: (1 > 0), }, // true  });  <div class="example">      <div v­if="cond">Yes</div>      <div v­else>No</div>  </div>
  • 10. 4 . 3 WITH A TEMPLATE <!­­ HTML ­­>  <template v­if="cond">      <h1>Title</h1>      <p>Paragraph 1</p>      <p>Paragraph 2</p>  </template>  = <!­­ HTML ­­>  <h1>Title</h1>  <p>Paragraph 1</p>  <p>Paragraph 2</p> 
  • 12. 4 . 5 V‐FOR USING AN OBJECT // JavaScript  var example = new Vue({      el:   '.example',      data: { object: FirstName: 'Jonathan', LastName: 'Goode', Age: 30, },  });  <!­­ HTML ­­>  <ul class="example">      <li v­for="value in object">{{ $key }}: {{ value }}</li>  </ul>
  • 13. 4 . 6 V‐FOR USING A RANGE // JavaScript  var example = new Vue({      el: '.example',  });  <!­­ HTML ­­>  <ul class="example">      <li v­for="n in 10">{{ n }}</li>  </ul>
  • 14. 4 . 7 V‐FOR USING A FILTER What will the output be? // JavaScript  var example = new Vue({      el:   '.example',      data: { array: [2, 4, 6, 8, 10,], },  });  <!­­ HTML ­­>  <ul class="example">      <li v­for="n in array | limitBy 3">{{ n }}</li>  </ul>
  • 15. 5 VUE AND EVENT HANDLING <!­­ HTML ­­>  <a v­on:click="doSomething">Link</a>  <a @click="doSomething">Link</a><!­­ shorthand syntax ­­>  // Modifiers  <!­­ with event.preventDefault() ­­>  <a @click.prevent="doSomething">Link</a>  <!­­ with event.stopPropagation() ­­>  <a @click.stop="doSomething">Link</a>  <!­­ with event.preventDefault() and event.stopPropagation() ­­>  <a @click.stop.prevent="doSomething">Link</a> 
  • 18. 8 VUE EXPLAINED HELLO WORLD EXAMPLE ⇲ The data for the view goes in an object called data This can get there and look however you want Functions are written as callbacks that go into a methods object They can do or return whatever you want var journal = new Vue({      el: '.journal',      data: { message: 'Hello World' }, methods: { },  }); <div class="journal">      <input type="text" v­model="message"><pre>{{ message | json }}</pre>  </div>
  • 19. 9 INPUT COUNTER EXAMPLE ⇲ // JavaScript  new Vue({      el:      '.question­text',      data:    { questions: [{ question_text: '', }], },      methods: { getLength: function(key){          return mb_strlen(this.questions[0][key]);      }, },  }); <!­­ HTML ­­>  <small v­bind:class="{ 'red': getLength('question_text') > 499 }"         v­cloak class="pull­right">Characters:      <span v­bind:class="{'text­embolden': getLength('question_text') > 500}"         @{{ getLength('question_text') }}      </span> / 500  </small>
  • 20. 10 . 1 VUE DIRECTIVES Custom directives provide a mechanism for mapping data changes to arbitrary DOM behaviour "seiyria‐bootstrap‐slider": "7.0.3" Vue.directive('slider', {      bind: function(){ /* do preparation work */          var vm  = this.vm;          var key = this.expression;          var slider = $(this.el).slider()              .on('change', function(ev){ vm.$set(key, ev.value.newValue); })             .data('slider');      },      update: function(val){ /* do something based on initial/updated value */         val = parseFloat(val);          if(!isNaN(val)){ $(this.el).slider('setValue', val); }      },      unbind: function(){ /* do clean up work */ },  });
  • 21. 10 . 2 SLIDER EXAMPLE ⇲ // JavaScript  new Vue({      el:   '.form­alerts',      data: alerts: [{ id: '', alert_message: '', alert_time: '' }],  }); <!­­ HTML ­­>  <template v­for="alert in alerts">      <input          class="form­control station­alert­time"          name="station_alert_time"          type="text"          v­slider="alerts[$index].alert_time"          v­model="alerts[$index].alert_time"          data­slider­min="0.5"          data­slider­max="5"          data­slider­step="0.5"          data­slider­value="2.5">  </template>
  • 22. 11 VUE PLUGINS Provides services for making web requests and handling responses using an XMLHttpRequest or JSONP The HTTP client for Vue.js Centralised State Management for Vue.js Similar to (Re)Flux for React Bootstrap components built with Vue.js No jQuery, bootstrap.js, or any third party plugins required VueResource VueRouter VueX VueStrap