Jan 9 in Vue.JS

How can props specify type requirements for props?

1 Answer

Jan 9

By implementing prop validation options, we can specify type requirements for individual props. This has no implication in production but throws warnings during the development phase, thereby helping the developer identify potential issues with incoming data and the particular type requirements for a prop. 

An example of configuring three props:

props: {
    accountNumber: {
        type: Number,
        required: true
    name: {
        type: String,
        required: true
   favoriteColors: Array

Click here to read more about Vue JS
Click here to read more about Insurance

Related questions

Jan 12 in Big Data | Hadoop
Feb 7 in Onsen UI
Oct 21, 2019 in Vue.JS