Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
genary
uni-app
提交
c26aaade
U
uni-app
项目概览
genary
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
c26aaade
编写于
7月 08, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wip(app): uni-app-plus
上级
eca0cc12
变更
17
展开全部
隐藏空白更改
内联
并排
Showing
17 changed file
with
715 addition
and
690 deletion
+715
-690
package.json
package.json
+1
-1
packages/playground/ssr/package.json
packages/playground/ssr/package.json
+1
-1
packages/playground/ssr/yarn.lock
packages/playground/ssr/yarn.lock
+40
-40
packages/shims-uni-app.d.ts
packages/shims-uni-app.d.ts
+2
-0
packages/uni-api/src/helpers/api/promise.ts
packages/uni-api/src/helpers/api/promise.ts
+3
-3
packages/uni-api/src/helpers/requestComponentObserver.ts
packages/uni-api/src/helpers/requestComponentObserver.ts
+3
-2
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+14
-31
packages/uni-app-plus/src/service/api/ui/popup/showToast.ts
packages/uni-app-plus/src/service/api/ui/popup/showToast.ts
+3
-2
packages/uni-app-vue/dist/service.runtime.esm.js
packages/uni-app-vue/dist/service.runtime.esm.js
+431
-447
packages/uni-cli-shared/src/preprocess/context.ts
packages/uni-cli-shared/src/preprocess/context.ts
+76
-36
packages/uni-cli-shared/src/preprocess/index.ts
packages/uni-cli-shared/src/preprocess/index.ts
+18
-5
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+4
-5
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+12
-11
packages/uni-mp-alipay/dist/uni.mp.esm.js
packages/uni-mp-alipay/dist/uni.mp.esm.js
+1
-1
packages/uni-mp-vue/dist/vue.runtime.esm.js
packages/uni-mp-vue/dist/vue.runtime.esm.js
+1
-1
packages/vite-plugin-uni/src/configResolved/index.ts
packages/vite-plugin-uni/src/configResolved/index.ts
+2
-1
yarn.lock
yarn.lock
+103
-103
未找到文件。
package.json
浏览文件 @
c26aaade
...
...
@@ -86,7 +86,7 @@
"
semver
"
:
"
^7.3.4
"
,
"
ts-jest
"
:
"
^27.0.3
"
,
"
typescript
"
:
"
~4.1.3
"
,
"
vite
"
:
"
^2.4.
0
"
,
"
vite
"
:
"
^2.4.
1
"
,
"
vue
"
:
"
^3.1.2
"
,
"
yorkie
"
:
"
^2.0.0
"
},
...
...
packages/playground/ssr/package.json
浏览文件 @
c26aaade
...
...
@@ -31,6 +31,6 @@
"compression"
:
"^1.7.4"
,
"cypress"
:
"^7.3.0"
,
"serve-static"
:
"^1.14.1"
,
"vite"
:
"^2.4.
0
"
"vite"
:
"^2.4.
1
"
}
}
packages/playground/ssr/yarn.lock
浏览文件 @
c26aaade
...
...
@@ -148,39 +148,39 @@
integrity sha512-LfZwXoGUDo0C3me81HXgkBg5CTQYb6xzEl+fNmbO4JdRiSKQ8A0GD1OBBvKAIsbCUgoyAty7m99GqqMQe784ew==
"@types/fs-extra@^8.0.1":
version "8.1.
1
"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-8.1.
1.tgz#1e49f22d09aa46e19b51c0b013cb63d0d923a068
"
integrity sha512-
TcUlBem321DFQzBNuz8p0CLLKp0VvF/XH9E4KHNmgwyp4E3AfgI5cjiIVZWlbfThBop2qxFIh4+LeY6hVWWZ2w
==
version "8.1.
2
"
resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-8.1.
2.tgz#7125cc2e4bdd9bd2fc83005ffdb1d0ba00cca61f
"
integrity sha512-
SvSrYXfWSc7R4eqnOzbQF4TZmfpNSM9FrSWLU3EUnWBuyZqNBOrv1B1JA3byUDPUl9z4Ab3jeZG2eDdySlgNMg
==
dependencies:
"@types/node" "*"
"@types/glob@^7.1.1":
version "7.1.
3
"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.
3.tgz#e6ba80f36b7daad2c685acd9266382e68985c183
"
integrity sha512-
SEYeGAIQIQX8NN6LDKprLjbrd5dARM5EXsd8GI/A5l0apYI1fGMWgPHSe4ZKL4eozlAyI+doUE9XbYS4xCkQ1w
==
version "7.1.
4
"
resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.1.
4.tgz#ea59e21d2ee5c517914cb4bc8e4153b99e566672
"
integrity sha512-
w+LsMxKyYQm347Otw+IfBXOv9UWVjpHpCDdbBMt8Kz/xbvCYNjP+0qPh91Km3iKfSRLBB0P7fAMf0KHrPu+MyA
==
dependencies:
"@types/minimatch" "*"
"@types/node" "*"
"@types/minimatch@*":
version "3.0.
4
"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.
4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21
"
integrity sha512-
1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA
==
version "3.0.
5
"
resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.
5.tgz#1001cc5e6a3704b83c236027e77f2f58ea010f40
"
integrity sha512-
Klz949h02Gz2uZCMGwDUSDS1YBlTdDDgbWHi+81l29tQALUtvz4rAYi5uoVhE5Lagoq6DeqAUlbrHvW/mXDgdQ
==
"@types/node@*":
version "16.0.
0
"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.0.
0.tgz#067a6c49dc7a5c2412a505628e26902ae967bf6f
"
integrity sha512-
TmCW5HoZ2o2/z2EYi109jLqIaPIi9y/lc2LmDCWzuCi35bcaQ+OtUh6nwBiFK7SOu25FAU5+YKdqFZUwtqGSd
g==
version "16.0.
1
"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.0.
1.tgz#70cedfda26af7a2ca073fdcc9beb2fff4aa693f8
"
integrity sha512-
hBOx4SUlEPKwRi6PrXuTGw1z6lz0fjsibcWCM378YxsSu/6+C30L6CR49zIBKHiwNWCYIcOLjg4OHKZaFeLAu
g==
"@types/node@^14.14.31":
version "14.17.
4
"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.
4.tgz#218712242446fc868d0e007af29a4408c7765bc0
"
integrity sha512-
8kQ3+wKGRNN0ghtEn7EGps/B8CzuBz1nXZEIGGLP2GnwbqYn4dbTs7k+VKLTq1HvZLRCIDtN3Snx1Ege8B7L5
A==
version "14.17.
5
"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.17.
5.tgz#b59daf6a7ffa461b5648456ca59050ba8e40ed54
"
integrity sha512-
bjqH2cX/O33jXT/UmReo2pM7DIJREPMnarixbQ57DOOzzFaI6D2+IcwaJQaJpv0M1E9TIhPCYVxrkcityLjlq
A==
"@types/sinonjs__fake-timers@^6.0.2":
version "6.0.
2
"
resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.
2.tgz#3a84cf5ec3249439015e14049bd3161419bf9eae
"
integrity sha512-
dIPoZ3g5gcx9zZEszaxLSVTvMReD3xxyyDnQUjA6IYDG9Ba2AV0otMPs+77sG9ojB4Qr2N2Vk5RnKeuA0X/0b
g==
version "6.0.
3
"
resolved "https://registry.yarnpkg.com/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.
3.tgz#79df6f358ae8f79e628fe35a63608a0ea8e7cf08
"
integrity sha512-
E1dU4fzC9wN2QK2Cr1MLCfyHM8BoNnRFvuf45LYMPNDA+WqbNzC45S4UzPxvp1fFJ1rvSGU0bPvdd35VLmXG8
g==
"@types/sizzle@^2.3.2":
version "2.3.3"
...
...
@@ -505,9 +505,9 @@ cachedir@^2.3.0:
integrity sha512-A+Fezp4zxnit6FanDmv9EqXNAi3vt9DWp51/71UEhXukb7QUuvtv9344h91dyAxuTLoSYJFU299qzR3tzwPAhw==
caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.30001230:
version "1.0.3000124
2
"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.3000124
2.tgz#04201627abcd60dc89211f22cbe2347306cda46b
"
integrity sha512-
KvNuZ/duufelMB3w2xtf9gEWCSxJwUgoxOx5b6ScLXC4kPc9xsczUVCPrQU26j5kOsHM4pSUL54tAZt5THQKug
==
version "1.0.3000124
3
"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.3000124
3.tgz#d9250155c91e872186671c523f3ae50cfc94a3aa
"
integrity sha512-
vNxw9mkTBtkmLFnJRv/2rhs1yufpDfCkBZexG3Y0xdOH2Z/eE/85E4Dl5j1YUN34nZVsSp6vVRFQRrez9wJMRA
==
caseless@~0.12.0:
version "0.12.0"
...
...
@@ -685,9 +685,9 @@ csstype@^2.6.8:
integrity sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==
cypress@^7.3.0:
version "7.
6
.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.
6.0.tgz#80fe7496cd4165a0fa06e25fc11413dda4544463
"
integrity sha512-
tTwQExY28CKt6cY85/2V1uLExcMfpBEBWXt/EcE2ht/Onl9k4lxUS7ul1UnUO5MrYwMIHMdGVh13DxdzXj4Z5w
==
version "7.
7
.0"
resolved "https://registry.yarnpkg.com/cypress/-/cypress-7.
7.0.tgz#0839ae28e5520536f9667d6c9ae81496b3836e64
"
integrity sha512-
uYBYXNoI5ym0UxROwhQXWTi8JbUEjpC6l/bzoGZNxoKGsLrC1SDPgIDJMgLX/MeEdPL0UInXLDUWN/rSyZUCjQ
==
dependencies:
"@cypress/request" "^2.88.5"
"@cypress/xvfb" "^1.2.4"
...
...
@@ -739,9 +739,9 @@ dashdash@^1.12.0:
assert-plus "^1.0.0"
dayjs@^1.10.4:
version "1.10.
5
"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.
5.tgz#5600df4548fc2453b3f163ebb2abbe965ccfb986
"
integrity sha512-
BUFis41ikLz+65iH6LHQCDm4YPMj5r1YFLdupPIyM4SGcXMmtiLQ7U37i+hGS8urIuqe7I/ou3IS1jVc4nbN4g
==
version "1.10.
6
"
resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.10.
6.tgz#288b2aa82f2d8418a6c9d4df5898c0737ad02a63
"
integrity sha512-
AztC/IOW4L1Q41A86phW5Thhcrco3xuAA+YX/BLpLWWjRcTj5TOt/QImBLmCKlrF7u7k47arTnOyL6GnbG8Hvw
==
debug@2.6.9:
version "2.6.9"
...
...
@@ -800,9 +800,9 @@ ee-first@1.1.1:
integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=
electron-to-chromium@^1.3.723:
version "1.3.7
68
"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.7
68.tgz#bbe47394f0073c947168589b7d19388518a7a9a9
"
integrity sha512-
I4UMZHhVSK2pwt8jOIxTi3GIuc41NkddtKT/hpuxp9GO5UWJgDKTBa4TACppbVAuKtKbMK6BhQZvT5tFF1bcNA
==
version "1.3.7
70
"
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.7
70.tgz#a9e705a73315f4900880622b3ab76cf1d7221b77
"
integrity sha512-
Kyh8DGK1KfEZuYKIHvuOmrKotsKZQ+qBkDIWHciE3QoFkxXB1KzPP+tfLilSHAfxTON0yYMnFCWkQtUOR7g6KQ
==
emoji-regex@^8.0.0:
version "8.0.0"
...
...
@@ -834,9 +834,9 @@ enquirer@^2.3.6:
ansi-colors "^4.1.1"
esbuild@^0.12.8:
version "0.12.1
4
"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.1
4.tgz#43157dbd0b36d939247d4eb4909a4886ac40f82e
"
integrity sha512-
z8p+6FGiplR7a3pPonXREbm+8IeXjBGvDpVidZmGB/AJMsJSfGCU+n7KOMCazA9AwvagadRWBhiKorC0w9WJv
w==
version "0.12.1
5
"
resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.12.1
5.tgz#9d99cf39aeb2188265c5983e983e236829f08af0
"
integrity sha512-
72V4JNd2+48eOVCXx49xoSWHgC3/cCy96e7mbXKY+WOWghN00cCmlGnwVLRhRHorvv0dgCyuMYBZlM2xDM5OQ
w==
escalade@^3.1.1:
version "3.1.1"
...
...
@@ -1913,9 +1913,9 @@ rollup-plugin-copy@^3.4.0:
is-plain-object "^3.0.0"
rollup@^2.38.5:
version "2.52.
7
"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.52.
7.tgz#e15a8bf734f6e4c204b7cdf33521151310250cb2
"
integrity sha512-
55cSH4CCU6MaPr9TAOyrIC+7qFCHscL7tkNsm1MBfIJRRqRbCEY0mmeFn4Wg8FKsHtEH8r389Fz38r/o+kgXLg
==
version "2.52.
8
"
resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.52.
8.tgz#b6462f9c16ffe8995b9a2b313f2e4247fa75e4d9
"
integrity sha512-
IjAB0C6KK5/lvqzJWAzsvOik+jV5Bt907QdkQ/gDP4j+R9KYNI1tjqdxiPitGPVrWC21Mf/ucXgowUjN/VemaQ
==
optionalDependencies:
fsevents "~2.3.2"
...
...
@@ -2243,10 +2243,10 @@ verror@1.10.0:
core-util-is "1.0.2"
extsprintf "^1.2.0"
vite@^2.4.
0
:
version "2.4.
0
"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.4.
0.tgz#a591e4f2c996ae9a044093f629b418069629ca16
"
integrity sha512-
FR+1hCyGt8i+ijMe9z4tIfUQ7BQThxGevp3IlmdXDBSJEPjbeDznbuJa/QVzXw2Mpxh7KCmveVI082h8nzcCNw
==
vite@^2.4.
1
:
version "2.4.
1
"
resolved "https://registry.yarnpkg.com/vite/-/vite-2.4.
1.tgz#2e48b8dbfc69e4edbf7f4d1c0798d621585cb8da
"
integrity sha512-
4BpKRis9uxIqPfIEcJ18LTBsamqnDFxTx45CXwagHjNltHa6PFEvf8Pe6OpgIHb0OyWT30OXOSSQvdOaX4OBiQ
==
dependencies:
esbuild "^0.12.8"
postcss "^8.3.5"
...
...
packages/shims-uni-app.d.ts
浏览文件 @
c26aaade
...
...
@@ -155,6 +155,8 @@ declare namespace UniApp {
'
mp-toutiao
'
?:
PagesJsonPageStyle
'
mp-weixin
'
?:
PagesJsonPageStyle
'
quickapp-webview
'
?:
PagesJsonPageStyle
'
quickapp-webview-huawei
'
?:
PagesJsonPageStyle
'
quickapp-webview-union
'
?:
PagesJsonPageStyle
}
interface
PagesJsonPageStyle
extends
PagesJsonPagePlatformStyle
{
...
...
packages/uni-api/src/helpers/api/promise.ts
浏览文件 @
c26aaade
...
...
@@ -2,12 +2,12 @@ import { extend, isPlainObject, isFunction } from '@vue/shared'
import
{
API_SUCCESS
,
API_FAIL
,
API_COMPLETE
}
from
'
./callback
'
const
callbacks
=
[
API_SUCCESS
,
API_FAIL
,
API_COMPLETE
]
function
hasCallback
(
args
:
unknown
)
{
if
(
isPlainObject
(
args
)
&&
callbacks
.
find
((
cb
)
=>
isFunction
((
args
as
Record
<
string
,
any
>
)[
cb
]))
[
API_SUCCESS
,
API_FAIL
,
API_COMPLETE
].
find
((
cb
)
=>
isFunction
((
args
as
Record
<
string
,
any
>
)[
cb
])
)
)
{
return
true
}
...
...
packages/uni-api/src/helpers/requestComponentObserver.ts
浏览文件 @
c26aaade
import
{
getCustomDataset
}
from
'
@dcloudio/uni-shared
'
import
{
initIntersectionObserverPolyfill
}
from
'
./intersection-observer
'
export
interface
RequestComponentObserverOptions
{
...
...
@@ -38,8 +39,8 @@ export function requestComponentObserver(
boundingClientRect
:
normalizeRect
(
entrie
.
boundingClientRect
),
relativeRect
:
normalizeRect
(
entrie
.
rootBounds
!
),
time
:
Date
.
now
(),
// dataset: getCustomDataset(entrie.targe
t),
//
id: entrie.target.id,
dataset
:
getCustomDataset
(
entrie
.
target
as
HTMLElemen
t
),
id
:
entrie
.
target
.
id
,
})
})
},
...
...
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
c26aaade
...
...
@@ -406,10 +406,9 @@ var serviceContext = (function (vue) {
return
callbackId
;
}
const
callbacks$2
=
[
API_SUCCESS
,
API_FAIL
,
API_COMPLETE
];
function
hasCallback
(
args
)
{
if
(
isPlainObject
(
args
)
&&
callbacks$2
.
find
((
cb
)
=>
isFunction
(
args
[
cb
])))
{
[
API_SUCCESS
,
API_FAIL
,
API_COMPLETE
]
.
find
((
cb
)
=>
isFunction
(
args
[
cb
])))
{
return
true
;
}
return
false
;
...
...
@@ -2947,15 +2946,6 @@ var serviceContext = (function (vue) {
fail
:
warpPlusErrorCallback
(
reject
),
}));
};
}
function
callApiSync
(
api
,
args
,
resolve
,
reject
)
{
api
(
args
)
.
then
(()
=>
{
resolve
();
})
.
catch
((
errMsg
)
=>
{
reject
(
errMsg
);
});
}
const
STORAGE_DATA_TYPE
=
'
__TYPE
'
;
...
...
@@ -5132,15 +5122,10 @@ var serviceContext = (function (vue) {
let
isShowToast
=
false
;
let
toastType
=
''
;
let
timeout
;
const
showLoading
=
defineAsyncApi
(
API_SHOW_LOADING
,
(
args
,
{
resolve
,
reject
})
=>
{
callApiSync
(
showToast
,
extend
({},
args
,
{
type
:
'
loading
'
,
}),
resolve
,
reject
);
},
ShowLoadingProtocol
,
ShowLoadingOptions
);
const
hideLoading
=
defineAsyncApi
(
API_HIDE_LOADING
,
(
_
,
{
resolve
,
reject
})
=>
{
callApiSync
(
hide
,
'
loading
'
,
resolve
,
reject
);
});
const
showToast
=
defineAsyncApi
(
API_SHOW_TOAST
,
({
title
=
''
,
icon
=
'
success
'
,
image
=
''
,
duration
=
1500
,
mask
=
false
,
position
,
const
showLoading
=
defineAsyncApi
(
API_SHOW_LOADING
,
(
args
,
callbacks
)
=>
_showToast
(
extend
({},
args
,
{
type
:
'
loading
'
,
}),
callbacks
),
ShowLoadingProtocol
,
ShowLoadingOptions
);
const
_showToast
=
({
title
=
''
,
icon
=
'
success
'
,
image
=
''
,
duration
=
1500
,
mask
=
false
,
position
,
// @ts-ignore ToastType
type
=
'
toast
'
,
// @ts-ignore PlusNativeUIWaitingStyles
...
...
@@ -5205,13 +5190,14 @@ var serviceContext = (function (vue) {
hide
(
''
);
},
duration
);
return
resolve
();
}
,
ShowToastProtocol
,
ShowToastOptions
)
;
const
hideToast
=
defineAsyncApi
(
API_HIDE_TOAST
,
(
_
,
{
resolve
,
reject
})
=>
{
callApiSync
(
hide
,
'
toast
'
,
resolve
,
reject
);
}
);
function
hide
(
type
=
'
toast
'
)
{
};
const
showToast
=
defineAsyncApi
(
API_SHOW_TOAST
,
_showToast
,
ShowToastProtocol
,
ShowToastOptions
);
const
hideToast
=
defineAsyncApi
(
API_HIDE_TOAST
,
(
_
,
callbacks
)
=>
hide
(
'
toast
'
,
callbacks
)
);
const
hideLoading
=
defineAsyncApi
(
API_HIDE_LOADING
,
(
_
,
callbacks
)
=>
hide
(
'
loading
'
,
callbacks
)
);
function
hide
(
type
=
'
toast
'
,
callbacks
)
{
if
(
type
&&
type
!==
toastType
)
{
return
;
// 应该不需要失败回调,在页面后退时,会主动 hideToast 和 hideLoading,如果 reject 会出异常。
return
callbacks
&&
callbacks
.
resolve
();
}
if
(
timeout
)
{
clearTimeout
(
timeout
);
...
...
@@ -5226,9 +5212,7 @@ var serviceContext = (function (vue) {
toast
=
null
;
isShowToast
=
false
;
toastType
=
''
;
return
{
errMsg
:
'
hide:ok
'
,
};
return
callbacks
&&
callbacks
.
resolve
();
}
const
providers
=
{
...
...
@@ -7422,10 +7406,9 @@ var serviceContext = (function (vue) {
showModal
:
showModal
,
showActionSheet
:
showActionSheet
,
showLoading
:
showLoading
,
hideLoading
:
hideLoading
,
showToast
:
showToast
,
hideToast
:
hideToast
,
hide
:
hide
,
hide
Loading
:
hideLoading
,
getProvider
:
getProvider
,
login
:
login
,
getUserInfo
:
getUserInfo
,
...
...
packages/uni-app-plus/src/service/api/ui/popup/showToast.ts
浏览文件 @
c26aaade
...
...
@@ -135,7 +135,8 @@ function hide(
callbacks
?:
{
resolve
:
Resolve
;
reject
:
Reject
}
)
{
if
(
type
&&
type
!==
toastType
)
{
return
callbacks
?.
reject
()
// 应该不需要失败回调,在页面后退时,会主动 hideToast 和 hideLoading,如果 reject 会出异常。
return
callbacks
&&
callbacks
.
resolve
()
}
if
(
timeout
)
{
clearTimeout
(
timeout
)
...
...
@@ -149,5 +150,5 @@ function hide(
toast
=
null
isShowToast
=
false
toastType
=
''
return
callbacks
?
.
resolve
()
return
callbacks
&&
callbacks
.
resolve
()
}
packages/uni-app-vue/dist/service.runtime.esm.js
浏览文件 @
c26aaade
此差异已折叠。
点击以展开。
packages/uni-cli-shared/src/preprocess/context.ts
浏览文件 @
c26aaade
export
const
jsContext
=
{
VUE3
:
true
,
APP_PLUS
:
false
,
H5
:
true
,
MP_360
:
false
,
MP_ALIPAY
:
false
,
MP_BAIDU
:
false
,
MP_QQ
:
false
,
MP_TOUTIAO
:
false
,
MP_WEIXIN
:
false
,
QUICKAPP_NATIVE
:
false
,
QUICKAPP_WEBVIEW
:
false
,
QUICKAPP_WEBVIEW_UNION
:
false
,
QUICKAPP_WEBVIEW_HUAWEI
:
false
,
MP
:
false
,
APP
:
false
,
APP_PLUS_NVUE
:
false
,
APP_VUE
:
false
,
APP_NVUE
:
false
,
import
{
extend
}
from
'
@vue/shared
'
const
DEFAULT_KEYS
=
[
'
APP
'
,
'
APP_NVUE
'
,
'
APP_PLUS
'
,
'
APP_PLUS_NVUE
'
,
'
APP_VUE
'
,
'
H5
'
,
'
MP
'
,
'
MP_360
'
,
'
MP_ALIPAY
'
,
'
MP_BAIDU
'
,
'
MP_QQ
'
,
'
MP_TOUTIAO
'
,
'
MP_WEIXIN
'
,
'
MP_KUAISHOU
'
,
'
QUICKAPP_NATIVE
'
,
'
QUICKAPP_WEBVIEW
'
,
'
QUICKAPP_WEBVIEW_HUAWEI
'
,
'
QUICKAPP_WEBVIEW_UNION
'
,
'
VUE2
'
,
'
VUE3
'
,
]
as
const
const
preVueContext
=
Object
.
create
(
null
)
const
preNVueContext
=
Object
.
create
(
null
)
export
function
getPreVueContext
()
{
return
preVueContext
}
export
const
htmlContext
=
{
VUE3
:
true
,
APP_PLUS
:
false
,
H5
:
true
,
MP_360
:
false
,
MP_ALIPAY
:
false
,
MP_BAIDU
:
false
,
MP_QQ
:
false
,
MP_TOUTIAO
:
false
,
MP_WEIXIN
:
false
,
QUICKAPP_NATIVE
:
false
,
QUICKAPP_WEBVIEW
:
false
,
MP
:
false
,
APP
:
false
,
APP_PLUS_NVUE
:
false
,
APP_VUE
:
false
,
APP_NVUE
:
false
,
export
function
getPreNVueContext
()
{
return
preNVueContext
}
export
function
initPreContext
(
platform
:
UniApp
.
PLATFORM
,
userPreContext
?:
Record
<
string
,
boolean
>
)
{
const
vueContext
=
Object
.
create
(
null
)
const
nvueContext
=
Object
.
create
(
null
)
const
defaultContext
=
Object
.
create
(
null
)
DEFAULT_KEYS
.
forEach
((
key
)
=>
{
defaultContext
[
key
]
=
false
})
defaultContext
[
normalizeKey
(
platform
)]
=
true
vueContext
.
VUE3
=
true
nvueContext
.
VUE2
=
true
if
(
platform
===
'
app
'
||
platform
===
'
app-plus
'
)
{
defaultContext
.
APP
=
true
defaultContext
.
APP_PLUS
=
true
vueContext
.
APP_VUE
=
true
nvueContext
.
APP_NVUE
=
true
nvueContext
.
APP_PLUS_NVUE
=
true
}
else
if
(
platform
.
startsWith
(
'
mp-
'
))
{
defaultContext
.
MP
=
true
}
else
if
(
platform
.
startsWith
(
'
quickapp-webview
'
))
{
defaultContext
.
QUICKAPP_WEBVIEW
=
true
}
if
(
userPreContext
)
{
Object
.
keys
(
userPreContext
).
forEach
((
key
)
=>
{
defaultContext
[
normalizeKey
(
key
)]
=
!!
userPreContext
[
key
]
})
}
extend
(
preVueContext
,
defaultContext
,
vueContext
)
extend
(
preNVueContext
,
defaultContext
,
nvueContext
)
}
function
normalizeKey
(
name
:
string
)
{
return
name
.
replace
(
/-/g
,
'
_
'
).
toUpperCase
()
}
packages/uni-cli-shared/src/preprocess/index.ts
浏览文件 @
c26aaade
import
{
jsContext
}
from
'
./context
'
export
*
from
'
./context
'
import
{
getPreNVueContext
,
getPreVueContext
}
from
'
./context
'
/* eslint-disable no-restricted-globals */
const
{
preprocess
}
=
require
(
'
../../lib/preprocess
'
)
export
{
initPreContext
}
from
'
./context
'
export
function
preJs
(
jsCode
:
string
)
{
return
preprocess
(
jsCode
,
jsContext
,
{
type
:
'
js
'
})
return
preprocess
(
jsCode
,
getPreVueContext
()
,
{
type
:
'
js
'
})
}
export
function
preHtml
(
htmlCode
:
string
)
{
return
preprocess
(
htmlCode
,
jsContext
,
{
type
:
'
html
'
})
return
preprocess
(
htmlCode
,
getPreVueContext
()
,
{
type
:
'
html
'
})
}
export
const
preCss
=
preJs
export
const
preJson
=
preJs
export
function
preNVueJs
(
jsCode
:
string
)
{
return
preprocess
(
jsCode
,
getPreNVueContext
(),
{
type
:
'
js
'
})
}
export
function
preNVueHtml
(
htmlCode
:
string
)
{
return
preprocess
(
htmlCode
,
getPreNVueContext
(),
{
type
:
'
html
'
})
}
export
const
preNVueCss
=
preNVueJs
export
const
preNVueJson
=
preNVueJs
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
c26aaade
...
...
@@ -536,15 +536,15 @@ function getRealRoute(fromRoute, toRoute) {
fromRouteArray
.
splice
(
fromRouteArray
.
length
-
i
-
1
,
i
+
1
);
return
"
/
"
+
fromRouteArray
.
concat
(
toRouteArray
).
join
(
"
/
"
);
}
const
callbacks
$1
=
{};
const
callbacks
=
{};
function
createCallbacks
(
namespace
)
{
let
scopedCallbacks
=
callbacks
$1
[
namespace
];
let
scopedCallbacks
=
callbacks
[
namespace
];
if
(
!
scopedCallbacks
)
{
scopedCallbacks
=
{
id
:
1
,
callbacks
:
Object
.
create
(
null
)
};
callbacks
$1
[
namespace
]
=
scopedCallbacks
;
callbacks
[
namespace
]
=
scopedCallbacks
;
}
return
{
get
(
id
)
{
...
...
@@ -1250,9 +1250,8 @@ function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } =
});
return
callbackId
;
}
const
callbacks
=
[
API_SUCCESS
,
API_FAIL
,
API_COMPLETE
];
function
hasCallback
(
args
)
{
if
(
shared
.
isPlainObject
(
args
)
&&
callbacks
.
find
((
cb
)
=>
shared
.
isFunction
(
args
[
cb
])))
{
if
(
shared
.
isPlainObject
(
args
)
&&
[
API_SUCCESS
,
API_FAIL
,
API_COMPLETE
]
.
find
((
cb
)
=>
shared
.
isFunction
(
args
[
cb
])))
{
return
true
;
}
return
false
;
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
c26aaade
...
...
@@ -693,14 +693,14 @@ function attrChange(attr2) {
style[attr3] = elementComputedStyle[attr3];
});
changeAttrs.length = 0;
callbacks$
3
.forEach(function(callback) {
callbacks$
2
.forEach(function(callback) {
callback(style);
});
}, 0);
}
changeAttrs.push(attr2);
}
var callbacks$
3
= [];
var callbacks$
2
= [];
function onChange(callback) {
if (!getSupport()) {
return;
...
...
@@ -709,13 +709,13 @@ function onChange(callback) {
init();
}
if (typeof callback === "function") {
callbacks$
3
.push(callback);
callbacks$
2
.push(callback);
}
}
function offChange(callback) {
var index2 = callbacks$
3
.indexOf(callback);
var index2 = callbacks$
2
.indexOf(callback);
if (index2 >= 0) {
callbacks$
3
.splice(index2, 1);
callbacks$
2
.splice(index2, 1);
}
}
var safeAreaInsets = {
...
...
@@ -1039,15 +1039,15 @@ function getRouteOptions(path, alias = false) {
}
return __uniRoutes.find((route) => route.path === path);
}
const callbacks$
2
= {};
const callbacks$
1
= {};
function createCallbacks(namespace) {
let scopedCallbacks = callbacks$
2
[namespace];
let scopedCallbacks = callbacks$
1
[namespace];
if (!scopedCallbacks) {
scopedCallbacks = {
id: 1,
callbacks: Object.create(null)
};
callbacks$
2
[namespace] = scopedCallbacks;
callbacks$
1
[namespace] = scopedCallbacks;
}
return {
get(id2) {
...
...
@@ -2371,9 +2371,8 @@ function createAsyncApiCallback(name, args = {}, { beforeAll, beforeSuccess } =
});
return callbackId;
}
const callbacks$1 = [API_SUCCESS, API_FAIL, API_COMPLETE];
function hasCallback(args) {
if (isPlainObject(args) &&
callbacks$1
.find((cb) => isFunction(args[cb]))) {
if (isPlainObject(args) &&
[API_SUCCESS, API_FAIL, API_COMPLETE]
.find((cb) => isFunction(args[cb]))) {
return true;
}
return false;
...
...
@@ -5619,7 +5618,9 @@ function requestComponentObserver($el, options, callback) {
intersectionRect: normalizeRect(entrie.intersectionRect),
boundingClientRect: normalizeRect(entrie.boundingClientRect),
relativeRect: normalizeRect(entrie.rootBounds),
time: Date.now()
time: Date.now(),
dataset: getCustomDataset(entrie.target),
id: entrie.target.id
});
});
}, {
...
...
packages/uni-mp-alipay/dist/uni.mp.esm.js
浏览文件 @
c26aaade
import
{
capitalize
,
hasOwn
,
isArray
,
toNumber
,
isPlainObject
,
isObject
,
isFunction
,
extend
,
NOOP
,
EMPTY_OBJ
,
camelize
}
from
'
@vue/shared
'
;
import
{
hasOwn
,
isArray
,
toNumber
,
isPlainObject
,
isObject
,
capitalize
,
isFunction
,
extend
,
NOOP
,
EMPTY_OBJ
,
camelize
}
from
'
@vue/shared
'
;
function
setModel
(
target
,
key
,
value
,
modifiers
)
{
if
(
isArray
(
modifiers
))
{
...
...
packages/uni-mp-vue/dist/vue.runtime.esm.js
浏览文件 @
c26aaade
import
{
isFunction
,
extend
,
isSymbol
,
isMap
,
isObject
,
toRawType
,
def
,
isArray
,
isString
,
isPromise
,
toHandlerKey
,
remove
,
EMPTY_OBJ
,
camelize
,
capitalize
,
normalizeClass
,
normalizeStyle
,
isOn
,
NOOP
,
isGloballyWhitelisted
,
isIntegerKey
,
hasOwn
,
hasChanged
,
NO
,
invokeArrayFns
as
invokeArrayFns$1
,
makeMap
,
isSet
,
toNumber
,
hyphenate
,
isReservedProp
,
EMPTY_ARR
,
toTypeString
}
from
'
@vue/shared
'
;
import
{
isFunction
,
extend
,
isSymbol
,
isMap
,
isObject
,
toRawType
,
def
,
isArray
,
isString
,
isPromise
,
toHandlerKey
,
remove
,
EMPTY_OBJ
,
camelize
,
capitalize
,
normalizeClass
,
normalizeStyle
,
isOn
,
NOOP
,
isGloballyWhitelisted
,
isIntegerKey
,
hasOwn
,
hasChanged
,
invokeArrayFns
as
invokeArrayFns$1
,
makeMap
,
isSet
,
NO
,
toNumber
,
hyphenate
,
isReservedProp
,
EMPTY_ARR
,
toTypeString
}
from
'
@vue/shared
'
;
export
{
camelize
}
from
'
@vue/shared
'
;
import
{
injectHook
as
injectHook$1
}
from
'
vue
'
;
...
...
packages/vite-plugin-uni/src/configResolved/index.ts
浏览文件 @
c26aaade
import
{
Plugin
}
from
'
vite
'
// import { checkUpdate
} from '@dcloudio/uni-cli-shared'
import
{
initPreContext
/*,checkUpdate*/
}
from
'
@dcloudio/uni-cli-shared
'
import
{
VitePluginUniResolvedOptions
}
from
'
..
'
import
{
initEnv
}
from
'
./env
'
...
...
@@ -12,6 +12,7 @@ export function createConfigResolved(options: VitePluginUniResolvedOptions) {
initOptions
(
options
,
config
)
initPlugins
(
config
,
options
)
initCheckUpdate
()
initPreContext
(
options
.
platform
)
})
as
Plugin
[
'
configResolved
'
]
}
...
...
yarn.lock
浏览文件 @
c26aaade
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录