Life Cycle hooks in VueJs

Squash Apps Pvt Ltd
Squash Apps Pvt LtdSquash Apps Pvt Ltd
Life Cycle Hooks in VueJS
Presenter:
Abaya Rajashree A
Software Engineer
List of hooks:
● beforeCreate
● Created
● beforeMount 
● Mounted 
● beforeUpdate
● Updated
● beforeDestroy
● Destroyed
beforeCreate()
● First hook that gets called after
the Vue instance has been
initialized.
● Cannot interact with any parts of
the component as data
observation (reactivity), events,
computed properties and
watchers are yet to be set up.
created()
● This hook is called after the instance is
created.
● Now, the instance has finished
processing, data observation
(reactivity), computed properties,
methods, watchers and event
callbacks have been set up.
● Cannot interact with the DOM at this
stage because your component has
not been mounted.
beforeMount()
● At this stage, the template is
compiled(not rendered), either
from the template or render
options.
● This hook is not called during
server-side rendering.
mounted()
●  Called after the instance has been
mounted
● The component becomes fully
functional after the mounted hook
is called and we can fully interact
with it.
beforeUpdate()
●  Called anytime changes are made
to our data and the DOM needs to
be updated, right before the DOM
is patched.
● This is a good place to access the
existing DOM before an update.
updated()
●  It is fired after a change has been
made.
● Component’s DOM would have
been updated when this hook is
called, so you can perform DOM-
dependent operations here.
beforeDestroy()
●  Called right before a Vue instance
is destroyed.
● At this stage the instance is still
fully functional.
● This hook is not called during
server-side rendering.
destroyed()
●  Called after a Vue instance has
been destroyed.
● All directives of the Vue instance
have been unbound, all event
listeners have been removed, and
all child Vue instances have also
been destroyed.
Flow Diagram: Life Cycle Hooks(flow)
Reference links
● https://vuejs.org/v2/guide/instance.
html#Lifecycle-Diagram
● https://dev.to/samolabams/underst
anding-vuejs-lifecycle-hooks-5ejk
Thank You!
1 sur 13

Recommandé

Vue.js Getting Started par
Vue.js Getting StartedVue.js Getting Started
Vue.js Getting StartedMurat Doğan
1.4K vues45 diapositives
An Introduction to Vuejs par
An Introduction to VuejsAn Introduction to Vuejs
An Introduction to VuejsPaddy Lock
4.6K vues13 diapositives
Introduction to React JS par
Introduction to React JSIntroduction to React JS
Introduction to React JSBethmi Gunasekara
426 vues31 diapositives
Vue.js par
Vue.jsVue.js
Vue.jsJadson Santos
10.6K vues94 diapositives
React JS - A quick introduction tutorial par
React JS - A quick introduction tutorialReact JS - A quick introduction tutorial
React JS - A quick introduction tutorialMohammed Fazuluddin
6.5K vues15 diapositives
The Point of Vue - Intro to Vue.js par
The Point of Vue - Intro to Vue.jsThe Point of Vue - Intro to Vue.js
The Point of Vue - Intro to Vue.jsHolly Schinsky
1.6K vues30 diapositives

Contenu connexe

Tendances

Introduction to ReactJS par
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJSKnoldus Inc.
2.3K vues14 diapositives
reactJS par
reactJSreactJS
reactJSSyam Santhosh
612 vues30 diapositives
An introduction to Vue.js par
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.jsJavier Lafora Rey
1.9K vues149 diapositives
An Overview on Nuxt.js par
An Overview on Nuxt.jsAn Overview on Nuxt.js
An Overview on Nuxt.jsSquash Apps Pvt Ltd
624 vues15 diapositives
Introduction to react js par
Introduction to react jsIntroduction to react js
Introduction to react jsAeshan Wijetunge
610 vues19 diapositives
Vue, vue router, vuex par
Vue, vue router, vuexVue, vue router, vuex
Vue, vue router, vuexSamundra khatri
849 vues29 diapositives

Tendances(20)

Introduction to ReactJS par Knoldus Inc.
Introduction to ReactJSIntroduction to ReactJS
Introduction to ReactJS
Knoldus Inc.2.3K vues
introduction to Vue.js 3 par ArezooKmn
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
ArezooKmn895 vues
React.js - The Dawn of Virtual DOM par Jimit Shah
React.js - The Dawn of Virtual DOMReact.js - The Dawn of Virtual DOM
React.js - The Dawn of Virtual DOM
Jimit Shah1.4K vues
Giới thiệu Nuxt.js par Robin Huy
Giới thiệu Nuxt.jsGiới thiệu Nuxt.js
Giới thiệu Nuxt.js
Robin Huy331 vues
An introduction to Vue.js par Pagepro
An introduction to Vue.jsAn introduction to Vue.js
An introduction to Vue.js
Pagepro440 vues
Events and Listeners in Android par ma-polimi
Events and Listeners in AndroidEvents and Listeners in Android
Events and Listeners in Android
ma-polimi3.3K vues
RxJS Evolved par trxcllnt
RxJS EvolvedRxJS Evolved
RxJS Evolved
trxcllnt3.4K vues
Meetup React Sanca - 29/11/18 - React Testing par Augusto Lazaro
Meetup React Sanca - 29/11/18 - React TestingMeetup React Sanca - 29/11/18 - React Testing
Meetup React Sanca - 29/11/18 - React Testing
Augusto Lazaro223 vues
React-JS Component Life-cycle Methods par ANKUSH CHAVAN
React-JS Component Life-cycle MethodsReact-JS Component Life-cycle Methods
React-JS Component Life-cycle Methods
ANKUSH CHAVAN1.7K vues

Similaire à Life Cycle hooks in VueJs

Protractor End To End Testing For AngularJS par
Protractor End To End Testing For AngularJSProtractor End To End Testing For AngularJS
Protractor End To End Testing For AngularJSKnoldus Inc.
69 vues20 diapositives
Workshop 14: AngularJS Parte III par
Workshop 14: AngularJS Parte IIIWorkshop 14: AngularJS Parte III
Workshop 14: AngularJS Parte IIIVisual Engineering
759 vues54 diapositives
Vuejs getting-started - Extended Version par
Vuejs getting-started - Extended VersionVuejs getting-started - Extended Version
Vuejs getting-started - Extended VersionMurat Doğan
815 vues70 diapositives
React workshop par
React workshopReact workshop
React workshopImran Sayed
1.8K vues60 diapositives
Frontend training par
Frontend trainingFrontend training
Frontend trainingAdrian Caetano
40 vues59 diapositives
Optimizing your use of react life cycles by shedrack akintayo par
Optimizing your use of react life cycles by shedrack akintayoOptimizing your use of react life cycles by shedrack akintayo
Optimizing your use of react life cycles by shedrack akintayoShedrack Akintayo
168 vues22 diapositives

Similaire à Life Cycle hooks in VueJs(20)

Protractor End To End Testing For AngularJS par Knoldus Inc.
Protractor End To End Testing For AngularJSProtractor End To End Testing For AngularJS
Protractor End To End Testing For AngularJS
Knoldus Inc.69 vues
Vuejs getting-started - Extended Version par Murat Doğan
Vuejs getting-started - Extended VersionVuejs getting-started - Extended Version
Vuejs getting-started - Extended Version
Murat Doğan815 vues
Optimizing your use of react life cycles by shedrack akintayo par Shedrack Akintayo
Optimizing your use of react life cycles by shedrack akintayoOptimizing your use of react life cycles by shedrack akintayo
Optimizing your use of react life cycles by shedrack akintayo
Drupalcon 2021 - Nuxt.js for drupal developers par nuppla
Drupalcon 2021 - Nuxt.js for drupal developersDrupalcon 2021 - Nuxt.js for drupal developers
Drupalcon 2021 - Nuxt.js for drupal developers
nuppla270 vues
Angular 16 – the rise of Signals par Coding Academy
Angular 16 – the rise of SignalsAngular 16 – the rise of Signals
Angular 16 – the rise of Signals
Coding Academy347 vues
Voorhoede - Front-end architecture par Jasper Moelker
Voorhoede - Front-end architectureVoorhoede - Front-end architecture
Voorhoede - Front-end architecture
Jasper Moelker6.2K vues
Which watcher watches CloudWatch par David Lutz
Which watcher watches CloudWatch Which watcher watches CloudWatch
Which watcher watches CloudWatch
David Lutz2.6K vues
React JS: A Secret Preview par valuebound
React JS: A Secret PreviewReact JS: A Secret Preview
React JS: A Secret Preview
valuebound3.3K vues
React and Flux life cycle with JSX, React Router and Jest Unit Testing par Eswara Kumar Palakollu
React and  Flux life cycle with JSX, React Router and Jest Unit TestingReact and  Flux life cycle with JSX, React Router and Jest Unit Testing
React and Flux life cycle with JSX, React Router and Jest Unit Testing
Automation Abstraction Layers: Page Objects and Beyond par Alan Richardson
Automation Abstraction Layers: Page Objects and BeyondAutomation Abstraction Layers: Page Objects and Beyond
Automation Abstraction Layers: Page Objects and Beyond
Alan Richardson67.3K vues

Plus de Squash Apps Pvt Ltd

The Critical role of Copyright par
The Critical role of CopyrightThe Critical role of Copyright
The Critical role of CopyrightSquash Apps Pvt Ltd
360 vues19 diapositives
Please review and merge par
Please review and mergePlease review and merge
Please review and mergeSquash Apps Pvt Ltd
73 vues14 diapositives
Angular Lifecycle Hooks par
Angular Lifecycle HooksAngular Lifecycle Hooks
Angular Lifecycle HooksSquash Apps Pvt Ltd
1.3K vues21 diapositives
Next Generation of Javascript par
Next Generation of JavascriptNext Generation of Javascript
Next Generation of JavascriptSquash Apps Pvt Ltd
78 vues15 diapositives
Hybrid app development frameworks par
Hybrid app development frameworksHybrid app development frameworks
Hybrid app development frameworksSquash Apps Pvt Ltd
72 vues26 diapositives
API Gateway with legend lambada par
API Gateway with legend lambadaAPI Gateway with legend lambada
API Gateway with legend lambadaSquash Apps Pvt Ltd
95 vues9 diapositives

Dernier

【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 par
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院IttrainingIttraining
58 vues8 diapositives
Evolving the Network Automation Journey from Python to Platforms par
Evolving the Network Automation Journey from Python to PlatformsEvolving the Network Automation Journey from Python to Platforms
Evolving the Network Automation Journey from Python to PlatformsNetwork Automation Forum
13 vues21 diapositives
Unit 1_Lecture 2_Physical Design of IoT.pdf par
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdfStephenTec
12 vues36 diapositives
Mini-Track: AI and ML in Network Operations Applications par
Mini-Track: AI and ML in Network Operations ApplicationsMini-Track: AI and ML in Network Operations Applications
Mini-Track: AI and ML in Network Operations ApplicationsNetwork Automation Forum
10 vues24 diapositives
Voice Logger - Telephony Integration Solution at Aegis par
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at AegisNirmal Sharma
39 vues1 diapositive
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors par
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensorssugiuralab
21 vues15 diapositives

Dernier(20)

【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院 par IttrainingIttraining
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
【USB韌體設計課程】精選講義節錄-USB的列舉過程_艾鍗學院
Unit 1_Lecture 2_Physical Design of IoT.pdf par StephenTec
Unit 1_Lecture 2_Physical Design of IoT.pdfUnit 1_Lecture 2_Physical Design of IoT.pdf
Unit 1_Lecture 2_Physical Design of IoT.pdf
StephenTec12 vues
Voice Logger - Telephony Integration Solution at Aegis par Nirmal Sharma
Voice Logger - Telephony Integration Solution at AegisVoice Logger - Telephony Integration Solution at Aegis
Voice Logger - Telephony Integration Solution at Aegis
Nirmal Sharma39 vues
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors par sugiuralab
TouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective SensorsTouchLog: Finger Micro Gesture Recognition  Using Photo-Reflective Sensors
TouchLog: Finger Micro Gesture Recognition Using Photo-Reflective Sensors
sugiuralab21 vues
Business Analyst Series 2023 - Week 3 Session 5 par DianaGray10
Business Analyst Series 2023 -  Week 3 Session 5Business Analyst Series 2023 -  Week 3 Session 5
Business Analyst Series 2023 - Week 3 Session 5
DianaGray10300 vues
Five Things You SHOULD Know About Postman par Postman
Five Things You SHOULD Know About PostmanFive Things You SHOULD Know About Postman
Five Things You SHOULD Know About Postman
Postman36 vues
HTTP headers that make your website go faster - devs.gent November 2023 par Thijs Feryn
HTTP headers that make your website go faster - devs.gent November 2023HTTP headers that make your website go faster - devs.gent November 2023
HTTP headers that make your website go faster - devs.gent November 2023
Thijs Feryn22 vues
Piloting & Scaling Successfully With Microsoft Viva par Richard Harbridge
Piloting & Scaling Successfully With Microsoft VivaPiloting & Scaling Successfully With Microsoft Viva
Piloting & Scaling Successfully With Microsoft Viva
Special_edition_innovator_2023.pdf par WillDavies22
Special_edition_innovator_2023.pdfSpecial_edition_innovator_2023.pdf
Special_edition_innovator_2023.pdf
WillDavies2218 vues
Data Integrity for Banking and Financial Services par Precisely
Data Integrity for Banking and Financial ServicesData Integrity for Banking and Financial Services
Data Integrity for Banking and Financial Services
Precisely25 vues

Life Cycle hooks in VueJs

  • 1. Life Cycle Hooks in VueJS Presenter: Abaya Rajashree A Software Engineer
  • 2. List of hooks: ● beforeCreate ● Created ● beforeMount  ● Mounted  ● beforeUpdate ● Updated ● beforeDestroy ● Destroyed
  • 3. beforeCreate() ● First hook that gets called after the Vue instance has been initialized. ● Cannot interact with any parts of the component as data observation (reactivity), events, computed properties and watchers are yet to be set up.
  • 4. created() ● This hook is called after the instance is created. ● Now, the instance has finished processing, data observation (reactivity), computed properties, methods, watchers and event callbacks have been set up. ● Cannot interact with the DOM at this stage because your component has not been mounted.
  • 5. beforeMount() ● At this stage, the template is compiled(not rendered), either from the template or render options. ● This hook is not called during server-side rendering.
  • 6. mounted() ●  Called after the instance has been mounted ● The component becomes fully functional after the mounted hook is called and we can fully interact with it.
  • 7. beforeUpdate() ●  Called anytime changes are made to our data and the DOM needs to be updated, right before the DOM is patched. ● This is a good place to access the existing DOM before an update.
  • 8. updated() ●  It is fired after a change has been made. ● Component’s DOM would have been updated when this hook is called, so you can perform DOM- dependent operations here.
  • 9. beforeDestroy() ●  Called right before a Vue instance is destroyed. ● At this stage the instance is still fully functional. ● This hook is not called during server-side rendering.
  • 10. destroyed() ●  Called after a Vue instance has been destroyed. ● All directives of the Vue instance have been unbound, all event listeners have been removed, and all child Vue instances have also been destroyed.
  • 11. Flow Diagram: Life Cycle Hooks(flow)
  • 12. Reference links ● https://vuejs.org/v2/guide/instance. html#Lifecycle-Diagram ● https://dev.to/samolabams/underst anding-vuejs-lifecycle-hooks-5ejk