vue.js - What is the best way to use Laravel route in Vue JS component - Stack Overflow

PHOTO EMBED

Mon Mar 28 2022 04:55:51 GMT+0000 (Coordinated Universal Time)

Saved by @oday #php

<!-- You can pass the route as props to the component inside the blade file.
 
Inside the view: -->


<component home-route="{{ route('home') }}"></component>


*/Inside the vue component:/*



<script> 
    export default {
        props: ['homeRoute'],
    }
</script>


<!-- Then you can access the route inside the component like so: -->

this.homeRoute
content_copyCOPY

https://stackoverflow.com/questions/46940318/what-is-the-best-way-to-use-laravel-route-in-vue-js-component