marcellopato's avatar

Can I $emit from a blade to a vue component?

Hello! I have this page and the data from a controller: 'vida_id' and 'cpf' My component is an upload image which I can reuse. How can I send 'vida_id' and 'cpf' from the blade to the component?

I use bus to send from a component to another, but this works with blade?

Thanks in advance!

0 likes
1 reply
Tomi's avatar

You do usually pass data via properties from blade to a Vue component.


Vue.component("blog-post", {
  props: ["postTitle"],
  template:"'<h3>{{ postTitle }}</h3>"
})

<blog-post post-title="hello!"></blog-post>

https://vuejs.org/v2/guide/components-props.html

edit: formating

Please or to participate in this conversation.