Build Reusable Vue.js Components

Share this video with your friends

Send Tweet

By building components, you can extend basic HTML elements and reuse encapsulated code. Most options that are passed into a Vue constructor can be passed into a component. Each instance of a component has an isolated scope. Data can only be passed one direction and it must be from parent to child using props. To communicate with the parent element, use the $emit method.

Christopher
Christopher
~ 8 years ago

Code preview is referencing

https://cdn.jsdelivr.net/vue/1.0.26/vue.min.js

should be

https://cdn.jsdelivr.net/vue/2.0.2/vue.min.js

sonim1
sonim1
~ 7 years ago

Christopher! Thanks, I was really confused.

Bach
Bach
~ 7 years ago

the initializer value for total doesnt seems right p/s: its about the vue version...fixed

Lars Devocht
Lars Devocht
~ 5 years ago

Hi Greg, thanks for the great corse. I found it confusing that you don't mention that “X-Templates” script is a part of a component definition. In this case the component definition seems split in two parts. Whithout that, it’s like “where is this script stuff coming from?”