http-vue-loader icon indicating copy to clipboard operation
http-vue-loader copied to clipboard

Ability to specify base path (e.g. for template image assets etc) ?

Open sp00x opened this issue 7 years ago • 2 comments

If there is a reference to an image asset within the template it seems the path is resolved relative to the initial Vue app, e.g. if the app is at localhost:8080/ and the .vue file is loaded from somewhere else but has e.g. <img src="assets/foo.png">, then that is resolved as localhost:8080/assets/foo.png

Is there any way of setting an additional "base path" per template loaded via http-vue-loader ?

sp00x avatar Jun 13 '18 11:06 sp00x

Do you have the base url set for your page?

OmgImAlexis avatar Jul 01 '18 06:07 OmgImAlexis

@OmgImAlexis That's not relevant or usable for me here, because the base of my main page is different than the base of the templates, which are loaded from different locations (long story).

Eg. my main page is at http://serv.er/xyz but temlplate assets might be at http://serv.er/xyz/some/where/else (for one template) and http://serv.er/xyz/or/even/here (for another template).

Right now all references are relative to the main page, so I have to inject the assets path as a prop into the templates so they know where to get their stuff at.

sp00x avatar Jul 01 '18 18:07 sp00x