Skip to content

vue.config.js,assetsDir设置为网址时,前面会多一个'/' #2660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
dficonfont opened this issue Sep 30, 2018 · 2 comments
Closed

Comments

@dficonfont
Copy link

Version

3.0.1

Node and OS info

v8.11.2

Steps to reproduce

因为程序嵌入别的网站,不在一级目录等各种原因,需要对资源路径设置网址,但是设置assetsDir为网址时,生成的index.html变成src=/http://......,这个是不是bug?

What is expected?

得到正确的路径

What is actually happening?

路径前面多了/

@haoqunjiang
Copy link
Member

  • 文档里写了,assetsDir 是一个相对路径,不是 url,所以这不是 bug
  • 不在一级目录请设置 baseUrl
  • 嵌入别的网站具体是什么样的需求?我不是很理解

@nyanboard
Copy link

现在我也碰到了此类问题,我现在想将项目通过cordova打包生成app,但是路径是生成‘/’开头的,这就变成了绝对路径,这并不是我想要的啊。
所以说我改如何想路径变成我想要的相对路径。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants