search

Home  >  Q&A  >  body text

How to display inertial data to a Vue component?

In the Vue Inspector I actually get the message, but I'm not sure how to use it on the Vue component.

Please view the picture link

https://ibb.co/2KTmstS

I'm using Inertia helper methods and sending messages to Vue components but nothing works.

public function contact_to_project(){
    $message = "My message!";
    return Inertia('Contact_to_project', [
        'message' => $message
    ]);

}

My Vue component

<template> {{message}}</template>


<script>
  export default {
     props: {
        message: String,
     },
  }
</script>


P粉517475670P粉517475670419 days ago506

reply all(1)I'll reply

  • P粉743288436

    P粉7432884362023-11-01 10:47:11

    Based on your question in vue component, you can define the data as props and then you can display it in template as shown below Example below:

    sssccc
    
    

    reply
    0
  • Cancelreply