Use BASE_URL in component’s JavaScript – Vue.js

You probably already know you can use BASE_URL in your HTML markup like this:

If you want to use it within JavaScript you can define a publicPath in your component's data like this:

Then simply use it as a regular .vue file or template like any variable:

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*