From the course: Vue.js 2 Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Prop options

Prop options

From the course: Vue.js 2 Essential Training

Start my 1-month free trial

Prop options

- [Instructor] So, right now, if I were to pass along, most of the information, leaving out something, like the conversion or the precision, the application really wouldn't know what to do. So, if I don't pass along the precision, then, it's just going to ignore the cent here, which is not exactly what I want. So, what I need to do is find a way of passing along default values. So, let me show you that when you pass along props, you can pass them along as either an array of elements or you can pass along an object. And the object is a little more flexible, because it allows you to specify things, like the type that each of the elements should be. And you can do this in other places as well. So, you can actually say, and let's get rid of all these quotes, because it's going to be an object, in each of the elements here, we're going to get. You know you can use this notation, object notation here for the props. And then, for each one of the props, you can specify a type if you want to…

Contents