propsData

propsData

1.0.22+

  • Type: Object

  • Restriction: only respected in instance creation via new.

  • Details:

    Pass props to an instance during its creation. This is primarily intended to make unit testing easier.

  • Example:

    var Comp = Vue.extend({
      props: ['msg'],
      template: '<div>{{ msg }}</div>'
    })
    
    var vm = new Comp({
      propsData: {
        msg: 'hello'
      }
    })
doc_VueJS
2016-09-25 05:48:12
Comments
Leave a Comment

Please login to continue.