Vue js. How do I get current url in index.html file? With pure js in index.html I get only url of the start page. To get the url of the other pages I have to refresh or the value of the initial page remains.
<!-- index.php laravel blade -->
<div id="ui">
<router-view></router-view>
</div>
<script>
window.CanvasUI = @json($config);
</script>
<script type="text/javascript" src="{{ asset(mix('js/canvas-ui.js')) }}"></script>
CodePudding user response:
With pure JS:
window.location.href
CodePudding user response:
Easy way to get baseUrl in VueJs is
var baseUrl = window.location.origin