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

chore: merge

......@@ -38,6 +38,7 @@ declare namespace UniApp {
router?: {
strict: boolean
base: string
assets: string
}
nvue?: {
'flex-direction': 'column' | 'row'
......
......@@ -6676,7 +6676,7 @@
animationType: "pop-in",
animationDuration: 200,
uniNView: {
path: "".concat(typeof process === "object" && process.env && {}.VUE_APP_TEMPLATE_PATH || "", "/").concat(url, ".js"),
path: "/".concat(url, ".js"),
defaultFontSize: 16,
viewport: plus_.screen.resolutionWidth
}
......
......@@ -1733,10 +1733,7 @@ function showPage({ context = {}, url, data = {}, style = {}, onMessage, onClose
animationType: 'pop-in',
animationDuration: 200,
uniNView: {
path: `${(typeof process === 'object' &&
process.env &&
process.env.VUE_APP_TEMPLATE_PATH) ||
''}/${url}.js`,
path: `/${url}.js`,
defaultFontSize: 16,
viewport: plus_.screen.resolutionWidth,
},
......
......@@ -219,7 +219,7 @@ function showPage({
animationType: "pop-in",
animationDuration: 200,
uniNView: {
path: `${typeof process === "object" && process.env && {}.VUE_APP_TEMPLATE_PATH || ""}/${url}.js`,
path: `/${url}.js`,
defaultFontSize: 16,
viewport: plus_.screen.resolutionWidth
}
......
......@@ -141,12 +141,7 @@ export function showPage({
animationType: 'pop-in',
animationDuration: 200,
uniNView: {
path: `${
(typeof process === 'object' &&
process.env &&
process.env.VUE_APP_TEMPLATE_PATH) ||
''
}/${url}.js`,
path: `/${url}.js`,
defaultFontSize: 16,
viewport: plus_.screen.resolutionWidth,
},
......
......@@ -10,6 +10,7 @@ import {
const defaultRouter = {
mode: 'hash',
base: '/',
assets: 'assets',
}
const defaultAsync = {
......@@ -25,6 +26,9 @@ export function uniManifestJsonPlugin(): Plugin {
return {
name: 'uni:h5-manifest-json',
enforce: 'pre',
configResolved(config) {
defaultRouter.assets = config.build.assetsDir
},
transform(code, id) {
if (!opts.filter(id)) {
return
......
......@@ -881,14 +881,17 @@ function addBase(filePath) {
return baseUrl + filePath;
}
function getRealPath(filePath) {
if (__uniConfig.router.base === "./") {
filePath = filePath.replace(/^\.\/static\//, "/static/");
const { base, assets } = __uniConfig.router;
if (base === "./") {
if (filePath.indexOf("./static/") === 0 || assets && filePath.indexOf("./" + assets + "/") === 0) {
filePath = filePath.slice(1);
}
}
if (filePath.indexOf("/") === 0) {
if (filePath.indexOf("//") === 0) {
filePath = "https:" + filePath;
} else {
return addBase(filePath.substr(1));
return addBase(filePath.slice(1));
}
}
if (uniShared.SCHEME_RE.test(filePath) || uniShared.DATA_RE.test(filePath) || filePath.indexOf("blob:") === 0) {
......
......@@ -1994,14 +1994,17 @@ function addBase(filePath) {
return baseUrl + filePath;
}
function getRealPath(filePath) {
if (__uniConfig.router.base === "./") {
filePath = filePath.replace(/^\.\/static\//, "/static/");
const { base, assets } = __uniConfig.router;
if (base === "./") {
if (filePath.indexOf("./static/") === 0 || assets && filePath.indexOf("./" + assets + "/") === 0) {
filePath = filePath.slice(1);
}
}
if (filePath.indexOf("/") === 0) {
if (filePath.indexOf("//") === 0) {
filePath = "https:" + filePath;
} else {
return addBase(filePath.substr(1));
return addBase(filePath.slice(1));
}
}
if (SCHEME_RE.test(filePath) || DATA_RE.test(filePath) || filePath.indexOf("blob:") === 0) {
......
......@@ -28,14 +28,20 @@ function addBase(filePath: string) {
export function getRealPath(filePath: string) {
// 相对路径模式对静态资源路径特殊处理
if (__uniConfig.router!.base === './') {
filePath = filePath.replace(/^\.\/static\//, '/static/')
const { base, assets } = __uniConfig.router!
if (base === './') {
if (
filePath.indexOf('./static/') === 0 ||
(assets && filePath.indexOf('./' + assets + '/') === 0)
) {
filePath = filePath.slice(1)
}
}
if (filePath.indexOf('/') === 0) {
if (filePath.indexOf('//') === 0) {
filePath = 'https:' + filePath
} else {
return addBase(filePath.substr(1))
return addBase(filePath.slice(1))
}
}
// 网络资源或base64
......
......@@ -5380,10 +5380,11 @@ function createInvoker(initialValue, instance) {
}
// 冒泡事件列表
const bubbles = [
'touchstart',
'touchmove',
'touchcancel',
'touchend',
// touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
// 'touchstart',
// 'touchmove',
// 'touchcancel',
// 'touchend',
'tap',
'longpress',
'longtap',
......
......@@ -96,10 +96,11 @@ function createInvoker(
}
// 冒泡事件列表
const bubbles = [
'touchstart',
'touchmove',
'touchcancel',
'touchend',
// touch事件暂不做延迟,否则在 Android 上会影响性能,比如一些拖拽跟手手势等
// 'touchstart',
// 'touchmove',
// 'touchcancel',
// 'touchend',
'tap',
'longpress',
'longtap',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册