[Vuejs]-How to pass a data from laravel into Vue Router?

1👍

You could define a JS global variable in your Blade file and then retrieves it from the router.

<script type="text/javascript">
    window.routerBaseURL = 'something';
</script>
new VueRouter({
    base: window.routerBaseURL,
    ...
});

Leave a comment