提交 8ea1aa04 编写于 作者: fxy060608's avatar fxy060608

fix(h5): base url

上级 5e4fefd1
......@@ -903,6 +903,9 @@ var index$C = /* @__PURE__ */ defineBuiltInComponent({
});
const baseUrl = __IMPORT_META_ENV_BASE_URL__;
function addBase(filePath) {
if (("/" + filePath).indexOf(baseUrl) === 0) {
return "/" + filePath;
}
return baseUrl + filePath;
}
function getRealPath(filePath) {
......
......@@ -1899,6 +1899,9 @@ function findElem(vm) {
}
const baseUrl = import.meta.env.BASE_URL;
function addBase(filePath) {
if (("/" + filePath).indexOf(baseUrl) === 0) {
return "/" + filePath;
}
return baseUrl + filePath;
}
function getRealPath(filePath) {
......
......@@ -19,6 +19,10 @@ export function findElem(vm: ComponentPublicInstance) {
const baseUrl = __IMPORT_META_ENV_BASE_URL__
function addBase(filePath: string) {
// filepath可能已经被补充了baseUrl
if (('/' + filePath).indexOf(baseUrl) === 0) {
return '/' + filePath
}
return baseUrl + filePath
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册