Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

vue watch props

new Vue({
  el: '#app',
  data: {
    text: 'Hello'
  },
  components: {
    'child' : {
      template: `<p>{{ myprop }}</p>`,
      props: ['myprop'],
      watch: { 
      	myprop: function(newVal, oldVal) { // watch it
          console.log('Prop changed: ', newVal, ' | was: ', oldVal)
        }
      }
    }
  }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: jquery version how 
Javascript :: unique string id js 
Javascript :: javascript e.key 
Javascript :: discord.js leave voice channel 
Javascript :: reverse geocoding javascript map 
Javascript :: download file javascript 
Javascript :: javascript get all classes 
Javascript :: handle error in promise chain 
Javascript :: javascript date pipe central timezone example 
Javascript :: date-and-time npm 
Javascript :: on scroll change navbar color 
Javascript :: hello world using alert 
Javascript :: js ajax receive html 
Javascript :: jspdf attach image file 
Javascript :: latitude and longitude distance calculate in node js 
Javascript :: difference between call and apply in js 
Javascript :: jboss session expiration time 
Javascript :: jquery await async 
Javascript :: Install react router in react app 
Javascript :: usestate remove from array 
Javascript :: Scrollbar inside Dropdown of antD component React 
Javascript :: react to string 
Javascript :: getcomputed style js 
Javascript :: how to auto refresh a div js 
Javascript :: reverse a number in javascript w3schools 
Javascript :: javascript password generator 
Javascript :: javascript redirect to home page 
Javascript :: initialize function javascript 
Javascript :: js random in range 
Javascript :: Html2Canvas screenshot and download 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =