vue 3 prop validation code example
Example 1: vue prop string or number
props: {
users_count: {
type: [Number, String],
required: true
}
},
Example 2: vue js props
Vue.component('blog-post', {
// camelCase in JavaScript
props: ['postTitle'],
template: '<h3>{{ postTitle }}</h3>'
})
<!-- kebab-case in HTML -->
<blog-post post-title="hello!"></blog-post>