Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

vuejs does props factory function have access to vue instance

Vue.component('foo', {
  template: '<div>{{ num }}</div>',
  props: {
    func: {
      type: Number,
      default: () => this.a,
    },
  },
  data() {
    return { 
      num: this.func(),
      a: -22
    }
  }
})

new Vue({
  el: '#app',
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vuejs #props #factory #function #access #vue #instance
ADD COMMENT
Topic
Name
6+5 =