November 2019
Beginner
804 pages
20h 1m
English
In addition to their name, props can have types, as well as validation rules:
props: {
title: String,
link: String,
visitors: Number,
isVisible: Boolean,
messages: Array,
owner: Object,
children: [Object, String] // multiple accepted types
}
If a type is defined for a property, Vue will ensure that you pass the expected types before creating the component.
Here's a more advanced example, with a required
Read now
Unlock full access