Skip to main content
Category:

Props are custom attributes you can register on a component. When a value is passed to a prop attribute, it becomes a property on that component instance.

Examples How to pass a title and a body to our blog post component:

<blog-post title="My journey with Vue" body="lorem ipsum"></blog-post>

<blog-post :title="title" :body="body"></blog-post>

 

Examples How to include these props in the list of props this component accepts, using a props option:

Vue.component('blog-post',

{

props: ['title','body'],

template: '<h3>{{ title }}</h3><p>{{ body }}</p>'

})

Riadh Rahmi

Senior Web Developer PHP/Drupal & Laravel

I am a senior web developer, I have experience in planning and developing large scale dynamic web solutions especially in Drupal & Laravel.

Web Posts

Search

Page Facebook