Define Props on a Vue Class with vue-property-decorator

John Lindquist
InstructorJohn Lindquist

Share this video with your friends

Send Tweet

vue-property-decorator allows you to define your properties directly on your class with a simple @Prop() decorator. This approach allows your classes to stay clean and flat compared to the traditional approach of defining a props object with each prop defined on it.

CSSSR
CSSSR
~ 3 years ago

But why @prop() decorator better than props: { }, second one most cleaner

Jack
Jack
~ 3 years ago

this course is more 'the authors personal and generally pointless preferences for code aesthetics' rather than 'advanced vue components'

Jasmine Xie
Jasmine Xie
~ 2 years ago

Coming from an Angular background... this looks almost exactly like Angular code.