Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Best Way to define Props vue

// Even better!
props: {
  status: {
    type: String,
    required: true,
    validator: function (value) {
      return [
        'syncing',
        'synced',
        'version-conflict',
        'error'
      ].indexOf(value) !== -1
    }
  }
}
Source by v2.vuejs.org #
 
PREVIOUS NEXT
Tagged: #Best #Way #define #Props #vue
ADD COMMENT
Topic
Name
9+4 =