SlideShare a Scribd company logo
Vue.js
Paul Bele - December 2019
Introduction to Vue.js
● Seriously, another Javascript framework?
● What’s special about Vue?
● Trends and stars
● Code examples
Introduction to Vue.js
● Github stars
○ Vue.js 151k
○ React 141k
○ Angular 59 k
● Google Trends
○ Passed React in August 2017
● Enterprise support
○ Alibaba, Baidu, Adobe, IBM, etc (https://github.com/vuejs/awesome-vue#enterprise-usage)
What is Vue?
Advantages
● Very Small Size
○ Angular: 500+ KB
○ React: 100 KB
○ Vue: 80 KB
● Performant (Virtual DOM)
● Uses same space with React and Angular
● Simple (One way data flow)
● Full-Featured API
● Powerful DevTools
● Active community
● Amazing documentation
● Easy to integrate into existing code base
Getting started
● Super easy way is to use JSFiddle Hello World example
(https://jsfiddle.net/chrisvfritz/50wL7mdz/)
● <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
● Vue-cli is not recommended for beginners, especially if you are not familiar
with node.js tools
Getting started
The VUE instance
● Ground Zero for a Vuejs app
● Accepts an object containing the Vue instance definition
● Most definitions are shared between instances and components
● Has lifecycle hooks which are functions that are called at specific points in the
app/component lifecycle
The VUE instance
● Element
○ Specifies the DOM element where the app will be rendered
Other Examples
Directives, Conditionals, Loops
The VUE instance
Methods
● Methods
○ Arbitrary functions
○ Can access/manipulate data
○ Can be called from templates, other methods
Templates
- HTML based Templating syntax
- “Mustache” {{}} syntax for string interpolation and dynamic variables
- Directives
- Prefixed with “v-”
- Accepted arguments separated by “:”
- Supported modifiers accepted by “.”
- Rendered via a virtual DOM, for efficient updates
Components
● Nested components hierarchy
● Each component renders either a template or returns
createElement() calls
● Components are typically defined in single files with <template>,
<script> and <style> sections
Components
● Re-usable. Can be packaged in libraries
● Leverages pre-processor (webpack, rollup) to support “all the
formats”
● HTML templates, are heavily borrowed from Angular (directives)
● CSS
○ Stylus, SCSS, PostCSS, etc
● JS
○ ES6, ES7, Typescript, etc
Example
Vue.js - Batteries included
- Vuex - Official app management system
- Atomic and centralized, similar to Redux
- Integrates with Vue Dev Tools
- Vue-router - Official SPA router
- Ecosystem
- Because Vue sits in the same “seams” as React, ideas are quickly pulled
from react world into Vue world
- 10k+ packages on npm with “vue” in the name
- Editor support: Atom, Sublime, Intelij, etc
Vue-router
- First-class Router for Vue.js applications
- Similar conventions to React-Router < v4 (or that’s what i heard)
- Modes for hash(default) and browser history
- Redirects, URL params, wildcard, full package!
Example using vue-cli
Vuex
- State management library, a la Redux
- Provides conventions/constraints around application state
- Single store
- Data access via “getters”
- Data modification via “mutations”
- Asynchronous work done in “actions”
Vuex
Vuex
● Vue.js is not “just” another Javascript framework
● Aims for a balance between rich, developer-friendly features and
clean, understandable code
● Community is vibrant and engaged, and shows every sign of being
in this for the long haul
● Vue.js is definitely worth learning, either as a first-timer’s Javascript
framework or developers looking for a fresh SPAs
Summary
Thank you!
Any questions?

More Related Content

What's hot

Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
sanskriti agarwal
 
Vue JS Intro
Vue JS IntroVue JS Intro
Vue JS Intro
Muhammad Rizki Rijal
 
VueJS: The Simple Revolution
VueJS: The Simple RevolutionVueJS: The Simple Revolution
VueJS: The Simple Revolution
Rafael Casuso Romate
 
Basics of VueJS
Basics of VueJSBasics of VueJS
Basics of VueJS
Squash Apps Pvt Ltd
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
David Ličen
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
Squash Apps Pvt Ltd
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
Chandrasekar G
 
Vue.js
Vue.jsVue.js
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
Pagepro
 
Java Spring
Java SpringJava Spring
Java Spring
AathikaJava
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Dinesh U
 
Nuxt.js - Introduction
Nuxt.js - IntroductionNuxt.js - Introduction
Nuxt.js - Introduction
Sébastien Chopin
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
Erik van Appeldoorn
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
David Ličen
 
Getting started with Next.js
Getting started with Next.jsGetting started with Next.js
Getting started with Next.js
Gökhan Sarı
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
Mohammed Fazuluddin
 
Deep dive into Vue.js
Deep dive into Vue.jsDeep dive into Vue.js
Deep dive into Vue.js
선협 이
 
NestJS
NestJSNestJS
NestJS
Wilson Su
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
Cere Labs Pvt. Ltd
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
Rob O'Doherty
 

What's hot (20)

Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
 
Vue JS Intro
Vue JS IntroVue JS Intro
Vue JS Intro
 
VueJS: The Simple Revolution
VueJS: The Simple RevolutionVueJS: The Simple Revolution
VueJS: The Simple Revolution
 
Basics of VueJS
Basics of VueJSBasics of VueJS
Basics of VueJS
 
Nuxt.JS Introdruction
Nuxt.JS IntrodructionNuxt.JS Introdruction
Nuxt.JS Introdruction
 
An Overview on Nuxt.js
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.js
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
 
Vue.js
Vue.jsVue.js
Vue.js
 
An introduction to Vue.js
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
 
Java Spring
Java SpringJava Spring
Java Spring
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Nuxt.js - Introduction
Nuxt.js - IntroductionNuxt.js - Introduction
Nuxt.js - Introduction
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
 
VueJS Introduction
VueJS IntroductionVueJS Introduction
VueJS Introduction
 
Getting started with Next.js
Getting started with Next.jsGetting started with Next.js
Getting started with Next.js
 
React JS - A quick introduction tutorial
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorial
 
Deep dive into Vue.js
Deep dive into Vue.jsDeep dive into Vue.js
Deep dive into Vue.js
 
NestJS
NestJSNestJS
NestJS
 
Introduction to NodeJS
Introduction to NodeJSIntroduction to NodeJS
Introduction to NodeJS
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 

Similar to Basics of Vue.js 2019

Introduction to Vue.js DevStaff Meetup 13.02
Introduction to Vue.js  DevStaff Meetup 13.02Introduction to Vue.js  DevStaff Meetup 13.02
Introduction to Vue.js DevStaff Meetup 13.02
Paul Bele
 
Vuejs and Web components - current state
Vuejs and Web components - current stateVuejs and Web components - current state
Vuejs and Web components - current state
Mikhail Kuznetcov
 
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Develcz
 
Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
nuppla
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
Eamonn Boyle
 
Vue.js - An Introduction
Vue.js - An IntroductionVue.js - An Introduction
Vue.js - An Introduction
saadulde
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJS
Gunnar Hillert
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
Lucas Jellema
 
[Nuxeo World 2013] Roadmap 2014 - Technical Part
[Nuxeo World 2013] Roadmap 2014 - Technical Part [Nuxeo World 2013] Roadmap 2014 - Technical Part
[Nuxeo World 2013] Roadmap 2014 - Technical Part
Nuxeo
 
Node.js an Exectutive View
Node.js an Exectutive ViewNode.js an Exectutive View
Node.js an Exectutive View
Manuel Eusebio de Paz Carmona
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
Betclic Everest Group Tech Team
 
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
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison
500Tech
 
JavaScript Modules Done Right
JavaScript Modules Done RightJavaScript Modules Done Right
JavaScript Modules Done Right
Mariusz Nowak
 
Dust.js
Dust.jsDust.js
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupal
Andriy Yun
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3Zachary Klein
 
Vue Introduction
Vue IntroductionVue Introduction
Vue Introduction
Elad Gasner
 
Pre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlifyPre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlify
nuppla
 
The Importance Things of Full Stack Development
The Importance Things of Full Stack DevelopmentThe Importance Things of Full Stack Development
The Importance Things of Full Stack Development
Mike Taylor
 

Similar to Basics of Vue.js 2019 (20)

Introduction to Vue.js DevStaff Meetup 13.02
Introduction to Vue.js  DevStaff Meetup 13.02Introduction to Vue.js  DevStaff Meetup 13.02
Introduction to Vue.js DevStaff Meetup 13.02
 
Vuejs and Web components - current state
Vuejs and Web components - current stateVuejs and Web components - current state
Vuejs and Web components - current state
 
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
Daniel Steigerwald: EsteJS - javascriptové aplikace robusně, modulárně a komf...
 
Drupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
 
ASP .Net Core SPA Templates
ASP .Net Core SPA TemplatesASP .Net Core SPA Templates
ASP .Net Core SPA Templates
 
Vue.js - An Introduction
Vue.js - An IntroductionVue.js - An Introduction
Vue.js - An Introduction
 
Creating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJSCreating Modular Test-Driven SPAs with Spring and AngularJS
Creating Modular Test-Driven SPAs with Spring and AngularJS
 
Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...Introduction to web application development with Vue (for absolute beginners)...
Introduction to web application development with Vue (for absolute beginners)...
 
[Nuxeo World 2013] Roadmap 2014 - Technical Part
[Nuxeo World 2013] Roadmap 2014 - Technical Part [Nuxeo World 2013] Roadmap 2014 - Technical Part
[Nuxeo World 2013] Roadmap 2014 - Technical Part
 
Node.js an Exectutive View
Node.js an Exectutive ViewNode.js an Exectutive View
Node.js an Exectutive View
 
Short-Training asp.net vNext
Short-Training asp.net vNextShort-Training asp.net vNext
Short-Training asp.net vNext
 
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...
 
ReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparisonReactJS vs AngularJS - Head to Head comparison
ReactJS vs AngularJS - Head to Head comparison
 
JavaScript Modules Done Right
JavaScript Modules Done RightJavaScript Modules Done Right
JavaScript Modules Done Right
 
Dust.js
Dust.jsDust.js
Dust.js
 
Code driven development in drupal
Code driven development in drupalCode driven development in drupal
Code driven development in drupal
 
Using React with Grails 3
Using React with Grails 3Using React with Grails 3
Using React with Grails 3
 
Vue Introduction
Vue IntroductionVue Introduction
Vue Introduction
 
Pre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlifyPre rendering media sites with nuxt.js & netlify
Pre rendering media sites with nuxt.js & netlify
 
The Importance Things of Full Stack Development
The Importance Things of Full Stack DevelopmentThe Importance Things of Full Stack Development
The Importance Things of Full Stack Development
 

Recently uploaded

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
Paul Groth
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
Safe Software
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
g2nightmarescribd
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Product School
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Ramesh Iyer
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Product School
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Inflectra
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
Product School
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 

Recently uploaded (20)

DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMsTo Graph or Not to Graph Knowledge Graph Architectures and LLMs
To Graph or Not to Graph Knowledge Graph Architectures and LLMs
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Essentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with ParametersEssentials of Automations: Optimizing FME Workflows with Parameters
Essentials of Automations: Optimizing FME Workflows with Parameters
 
Generating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using SmithyGenerating a custom Ruby SDK for your web service or Rails API using Smithy
Generating a custom Ruby SDK for your web service or Rails API using Smithy
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...Mission to Decommission: Importance of Decommissioning Products to Increase E...
Mission to Decommission: Importance of Decommissioning Products to Increase E...
 
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
Builder.ai Founder Sachin Dev Duggal's Strategic Approach to Create an Innova...
 
Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...Designing Great Products: The Power of Design and Leadership by Chief Designe...
Designing Great Products: The Power of Design and Leadership by Chief Designe...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 

Basics of Vue.js 2019

  • 1. Vue.js Paul Bele - December 2019
  • 2. Introduction to Vue.js ● Seriously, another Javascript framework? ● What’s special about Vue? ● Trends and stars ● Code examples
  • 3. Introduction to Vue.js ● Github stars ○ Vue.js 151k ○ React 141k ○ Angular 59 k ● Google Trends ○ Passed React in August 2017 ● Enterprise support ○ Alibaba, Baidu, Adobe, IBM, etc (https://github.com/vuejs/awesome-vue#enterprise-usage)
  • 5.
  • 6.
  • 7. Advantages ● Very Small Size ○ Angular: 500+ KB ○ React: 100 KB ○ Vue: 80 KB ● Performant (Virtual DOM) ● Uses same space with React and Angular ● Simple (One way data flow) ● Full-Featured API ● Powerful DevTools ● Active community ● Amazing documentation ● Easy to integrate into existing code base
  • 8. Getting started ● Super easy way is to use JSFiddle Hello World example (https://jsfiddle.net/chrisvfritz/50wL7mdz/) ● <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> ● Vue-cli is not recommended for beginners, especially if you are not familiar with node.js tools
  • 10. The VUE instance ● Ground Zero for a Vuejs app ● Accepts an object containing the Vue instance definition ● Most definitions are shared between instances and components ● Has lifecycle hooks which are functions that are called at specific points in the app/component lifecycle
  • 11. The VUE instance ● Element ○ Specifies the DOM element where the app will be rendered
  • 14. Methods ● Methods ○ Arbitrary functions ○ Can access/manipulate data ○ Can be called from templates, other methods
  • 15. Templates - HTML based Templating syntax - “Mustache” {{}} syntax for string interpolation and dynamic variables - Directives - Prefixed with “v-” - Accepted arguments separated by “:” - Supported modifiers accepted by “.” - Rendered via a virtual DOM, for efficient updates
  • 16. Components ● Nested components hierarchy ● Each component renders either a template or returns createElement() calls ● Components are typically defined in single files with <template>, <script> and <style> sections
  • 17. Components ● Re-usable. Can be packaged in libraries ● Leverages pre-processor (webpack, rollup) to support “all the formats” ● HTML templates, are heavily borrowed from Angular (directives) ● CSS ○ Stylus, SCSS, PostCSS, etc ● JS ○ ES6, ES7, Typescript, etc
  • 19. Vue.js - Batteries included - Vuex - Official app management system - Atomic and centralized, similar to Redux - Integrates with Vue Dev Tools - Vue-router - Official SPA router - Ecosystem - Because Vue sits in the same “seams” as React, ideas are quickly pulled from react world into Vue world - 10k+ packages on npm with “vue” in the name - Editor support: Atom, Sublime, Intelij, etc
  • 20. Vue-router - First-class Router for Vue.js applications - Similar conventions to React-Router < v4 (or that’s what i heard) - Modes for hash(default) and browser history - Redirects, URL params, wildcard, full package!
  • 22. Vuex - State management library, a la Redux - Provides conventions/constraints around application state - Single store - Data access via “getters” - Data modification via “mutations” - Asynchronous work done in “actions”
  • 23. Vuex
  • 24. Vuex
  • 25. ● Vue.js is not “just” another Javascript framework ● Aims for a balance between rich, developer-friendly features and clean, understandable code ● Community is vibrant and engaged, and shows every sign of being in this for the long haul ● Vue.js is definitely worth learning, either as a first-timer’s Javascript framework or developers looking for a fresh SPAs Summary

Editor's Notes

  1. Got really popular at the beginning of 2017. Laravel community started pick it up at about 2016 It passed ReactJS in terms of “github” popularity stars (151k vs 140k) at the time of writing It didn’t come up out of one of the big tech companies (Google, Amazon, Facebook). Evan You was at Google but it all started from the community effort
  2. It’s a view! Vue is a progressive framework for building user interfaces. Unlike other monolithic frameworks, Vue is designed from the ground up to be incrementally adoptable. The core library is focused on the view layer only, and is easy to pick up and integrate with other libraries or existing projects. On the other hand, Vue is also perfectly capable of powering sophisticated Single-Page Applications when used in combination with modern tooling and supporting libraries.
  3. It is in the same space on what react does. It is about what Angular 2 tries to do, but in a way easier format, although i didn’t tried it The idea is that Vue is all about everything that is interacting to what people are seeing on the screen. How it appears there, in a nice unidirectional flow. Start from one place and you control everything that appears on the screen You have a nice standard way of handling user interaction (click events,touch screen events, etc) Vue also took advantage of loads of lessons learned from React. We got things like Virtual DOM. Virtual DOM is what makes single place apps way faster than it used to be. For example jQuery, if you have 500 items, and if you want to change something in them, you have to select all of them and modify that property for them, or destroying the elements and recreating them. Browser doesn’t like that. It is very slow Virtual DOM makes it a lot faster by maintaining a model of what is already there and what it needs to do.
  4. In the Vue instance here, we have the html part. The id which is the “app” id where the app is hooking into the element and thus everything inside the div is controlled by Vue. When a Vue instance is created, it adds all the properties found in its data object to Vue’s reactivity system. When the values of those properties change, the view will “react”, updating to match the new values.
  5. Although not strictly associated with the MVVM pattern, Vue’s design was partly inspired by it. As a convention, we often use the variable vm (short for ViewModel) to refer to our Vue instance. When you create a Vue instance, you pass in an options object. The majority of this talk describes how you can use these options to create your desired behavior. For reference, you can also browse the full list of options in the API reference. A Vue application consists of a root Vue instance created with new Vue, optionally organized into a tree of nested, reusable components. For example, a todo app’s component tree might look like this:
  6. So the previous example looks just like HTML. What makes it special is this ID. This is the reference where Vue is hooking into the element and is controlling the entire nodes inside it.
  7. If you have not used AngularJS before, you probably don’t know what a directive is. Essentially, a directive is some special token in the markup that tells the library to do something to a DOM element. In Vue.js, the concept of directive is drastically simpler than that in Angular. A Vue.js directive can only appear in the form of a prefixed HTML attribute that takes the following format:
  8. Vue.js uses an HTML-based template syntax that allows you to declaratively bind the rendered DOM to the underlying Vue instance’s data. All Vue.js templates are valid HTML that can be parsed by spec-compliant browsers and HTML parsers. Under the hood, Vue compiles the templates into Virtual DOM render functions. Combined with the reactivity system, Vue is able to intelligently figure out the minimal number of components to re-render and apply the minimal amount of DOM manipulations when the app state changes. If you are familiar with Virtual DOM concepts and prefer the raw power of JavaScript, you can also directly write render functions instead of templates, with optional JSX support.
  9. Vue components are a nice vue innovation where they do exactly what each developer knows: html css and javascript. So why not...put it all together and make it all together and make it all part of the view framework. The idea in Vue is that you can combine all of them in a single Vue file ( might get some folks triggered about css being declared on a separate file but css is actually defined per component base). In react community and later angular they are kinda adopting react as well
  10. Vue components are a nice vue innovation where they do exactly what each developer knows: html css and javascript. So why not...put it all together and make it all together and make it all part of the view framework. The idea in Vue is that you can combine all of them in a single Vue file ( might get some folks triggered about css being declared on a separate file but css is actually defined per component base). In react community and later angular they are kinda adopting react as well. What you can also do with a Vue component is take leverage of pre-processors. In the time between react and angular was first made, this hole eco-systems was made up, starting with say gulp, and then webpack and rollup and other pre-processors.The entire idea is that you are not writing code that is executing in the browser anymore. This means that you are a lot freer about the code that you want it to be structure the way you want it to be. There is no such way to have a .vue file be loaded in the browser, it is just source, not executable code. Even though we are losing a bit of functionality with this, there are debuggers and tools that doesn’t tend to be a problem. React and Angular do the same thing, all modern web development runs through some pre-processor. That’s how we have typescript.
  11. The batteries are all included. Because vue sits in the same place as react did at the view layer, it’s taken all the different lessons learned and it copied them. Basically if you do something in react, you can do it in view. For example the flux related libraries for maintaining state. Officially endorsed one: Vuex
  12. Vue.js uses an HTML-based template syntax that allows you to declaratively bind the rendered DOM to the underlying Vue instance’s data. All Vue.js templates are valid HTML that can be parsed by spec-compliant browsers and HTML parsers. Under the hood, Vue compiles the templates into Virtual DOM render functions. Combined with the reactivity system, Vue is able to intelligently figure out the minimal number of components to re-render and apply the minimal amount of DOM manipulations when the app state changes. If you are familiar with Virtual DOM concepts and prefer the raw power of JavaScript, you can also directly write render functions instead of templates, with optional JSX support.
  13. Vuex helps us deal with shared state management with the cost of more concepts and boilerplate. It's a trade-off between short term and long term productivity. If you've never built a large-scale SPA and jump right into Vuex, it may feel verbose and daunting. That's perfectly normal - if your app is simple, you will most likely be fine without Vuex. A simple store pattern may be all you need. But if you are building a medium-to-large-scale SPA, chances are you have run into situations that make you think about how to better handle state outside of your Vue components, and Vuex will be the natural next step for you.