Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
7b45cf53
U
uni-app
项目概览
陈庄旺
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
7b45cf53
编写于
7月 02, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
chore: format log
上级
cf17189f
变更
29
隐藏空白更改
内联
并排
Showing
29 changed file
with
126 addition
and
76 deletion
+126
-76
packages/shims-vue-runtime.d.ts
packages/shims-vue-runtime.d.ts
+1
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+22
-22
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+17
-11
packages/uni-app-plus/src/helpers/plus.ts
packages/uni-app-plus/src/helpers/plus.ts
+2
-1
packages/uni-app-plus/src/service/api/location/getLocation.ts
...ages/uni-app-plus/src/service/api/location/getLocation.ts
+0
-10
packages/uni-app-plus/src/service/api/route/utils.ts
packages/uni-app-plus/src/service/api/route/utils.ts
+6
-3
packages/uni-app-plus/src/service/api/route/webview.ts
packages/uni-app-plus/src/service/api/route/webview.ts
+5
-4
packages/uni-app-plus/src/service/bridge/index.ts
packages/uni-app-plus/src/service/bridge/index.ts
+2
-1
packages/uni-app-plus/src/service/framework/app/index.ts
packages/uni-app-plus/src/service/framework/app/index.ts
+2
-2
packages/uni-app-plus/src/service/framework/app/initGlobalEvent.ts
...uni-app-plus/src/service/framework/app/initGlobalEvent.ts
+2
-1
packages/uni-app-plus/src/service/framework/page/register.ts
packages/uni-app-plus/src/service/framework/page/register.ts
+6
-2
packages/uni-app-plus/src/service/framework/page/setup.ts
packages/uni-app-plus/src/service/framework/page/setup.ts
+2
-1
packages/uni-app-plus/src/service/framework/webview/init/event/close.ts
...pp-plus/src/service/framework/webview/init/event/close.ts
+9
-1
packages/uni-app-plus/src/service/framework/webview/init/style.ts
.../uni-app-plus/src/service/framework/webview/init/style.ts
+2
-1
packages/uni-app-plus/src/service/framework/webview/nvue.ts
packages/uni-app-plus/src/service/framework/webview/nvue.ts
+4
-1
packages/uni-app-plus/src/service/framework/webview/preload.ts
...ges/uni-app-plus/src/service/framework/webview/preload.ts
+2
-1
packages/uni-app-plus/src/view/bridge/index.ts
packages/uni-app-plus/src/view/bridge/index.ts
+12
-2
packages/uni-core/src/helpers/bridge.ts
packages/uni-core/src/helpers/bridge.ts
+2
-3
packages/uni-h5/dist/uni-h5.cjs.js
packages/uni-h5/dist/uni-h5.cjs.js
+1
-1
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+2
-2
packages/uni-mp-alipay/src/runtime/createComponent.ts
packages/uni-mp-alipay/src/runtime/createComponent.ts
+1
-1
packages/uni-mp-alipay/src/runtime/util.ts
packages/uni-mp-alipay/src/runtime/util.ts
+1
-1
packages/uni-mp-core/src/index.ts
packages/uni-mp-core/src/index.ts
+0
-1
packages/uni-shared/dist/uni-shared.cjs.js
packages/uni-shared/dist/uni-shared.cjs.js
+7
-0
packages/uni-shared/dist/uni-shared.d.ts
packages/uni-shared/dist/uni-shared.d.ts
+2
-0
packages/uni-shared/dist/uni-shared.es.js
packages/uni-shared/dist/uni-shared.es.js
+7
-1
packages/uni-shared/src/index.ts
packages/uni-shared/src/index.ts
+1
-0
packages/uni-shared/src/log.ts
packages/uni-shared/src/log.ts
+5
-0
packages/vite-plugin-uni/bin/uni.js
packages/vite-plugin-uni/bin/uni.js
+1
-1
未找到文件。
packages/shims-vue-runtime.d.ts
浏览文件 @
7b45cf53
...
...
@@ -3,7 +3,7 @@ import { ComponentCustomProperties, ComponentInternalInstance } from 'vue'
declare
module
'
@vue/runtime-core
'
{
interface
ComponentCustomProperties
{
$scope
:
{
$getAppWebview
:
()
=>
PlusWebviewWebviewObject
$getAppWebview
?
:
()
=>
PlusWebviewWebviewObject
}
$page
:
Page
.
PageInstance
[
'
$page
'
]
__isTabBar
:
boolean
...
...
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
7b45cf53
...
...
@@ -565,6 +565,12 @@ var serviceContext = (function (vue) {
return
encode$3
(
arrayBuffer
);
},
ArrayBufferToBase64Protocol
);
function
formatLog
(
module
,
...
args
)
{
return
`[
${
Date
.
now
()}
][
${
module
}
]:
${
args
.
map
((
arg
)
=>
JSON
.
stringify
(
arg
))
.
join
(
'
'
)}
`
;
}
const
encode$2
=
encodeURIComponent
;
function
stringifyQuery$1
(
obj
,
encodeStr
=
encode$2
)
{
const
res
=
obj
...
...
@@ -1399,7 +1405,7 @@ var serviceContext = (function (vue) {
},
subscribeHandler
(
event
,
args
,
pageId
)
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`[subscribeHandler][
${
Date
.
now
()}
]:
${
subscribeNamespace
}
.
${
event
}
,
${
JSON
.
stringify
(
args
)}
,
${
pageId
}
`
);
console
.
log
(
formatLog
(
subscribeNamespace
,
'
subscribeHandler
'
,
pageId
,
event
,
args
)
);
}
emitter
.
emit
(
`
${
subscribeNamespace
}
.
${
event
}
`
,
args
,
pageId
);
},
...
...
@@ -4709,9 +4715,6 @@ var serviceContext = (function (vue) {
function
getLocationSuccess
(
type
,
position
,
resolve
)
{
const
coords
=
position
.
coords
;
if
(
type
!==
position
.
coordsType
)
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`UNIAPP[location]:before[
${
position
.
coordsType
}
][lng:
${
coords
.
longitude
}
,lat:
${
coords
.
latitude
}
]`
);
}
let
coordArray
;
if
(
type
===
'
wgs84
'
)
{
coordArray
=
gcj02towgs84
(
coords
.
longitude
,
coords
.
latitude
);
...
...
@@ -4722,9 +4725,6 @@ var serviceContext = (function (vue) {
if
(
coordArray
)
{
coords
.
longitude
=
coordArray
[
0
];
coords
.
latitude
=
coordArray
[
1
];
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`UNIAPP[location]:after[
${
type
}
][lng:
${
coords
.
longitude
}
,lat:
${
coords
.
latitude
}
]`
);
}
}
}
resolve
({
...
...
@@ -5562,7 +5562,7 @@ var serviceContext = (function (vue) {
}
function
subscribePlusMessage
({
data
,
})
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
'
plusMessage:
'
+
JSON
.
stringify
(
data
));
console
.
log
(
formatLog
(
'
plusMessage
'
,
data
));
}
if
(
data
&&
data
.
type
)
{
UniServiceJSBridge
.
subscribeHandler
(
'
plusMessage.
'
+
data
.
type
,
data
.
args
);
...
...
@@ -5812,7 +5812,7 @@ var serviceContext = (function (vue) {
const
curWebviewStyle
=
parseWebviewStyle
(
path
,
routeOptions
.
meta
);
curWebviewStyle
.
uniPageUrl
=
initUniPageUrl
(
path
,
query
);
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
'
[uni-app] createWebview
'
,
curWebviewId
,
path
,
curWebviewStyle
);
console
.
log
(
formatLog
(
'
createNVueWebview
'
,
curWebviewId
,
path
,
curWebviewStyle
)
);
}
curWebviewStyle
.
isTab
=
!!
routeOptions
.
meta
.
isTabBar
;
return
plus
.
webview
.
create
(
''
,
String
(
curWebviewId
),
curWebviewStyle
,
extend
({
...
...
@@ -5832,7 +5832,7 @@ var serviceContext = (function (vue) {
webviewStyle
.
isTab
=
isTabBar
;
}
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
'
[uni-app] updateWebview
'
,
webviewStyle
);
console
.
log
(
formatLog
(
'
updateWebview
'
,
webviewStyle
)
);
}
webview
.
setStyle
(
webviewStyle
);
}
...
...
@@ -5858,7 +5858,7 @@ var serviceContext = (function (vue) {
// 不存在,或已被使用
preloadWebview
=
plus
.
webview
.
create
(
VIEW_WEBVIEW_PATH
,
String
(
genWebviewId
()));
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`[uni-app] preloadWebview[
${
preloadWebview
.
id
}
]`
);
console
.
log
(
formatLog
(
'
createPreloadWebview
'
,
preloadWebview
.
id
)
);
}
}
return
preloadWebview
;
...
...
@@ -5951,7 +5951,7 @@ var serviceContext = (function (vue) {
}
function
registerApp
(
appVm
)
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
'
registerApp
'
);
console
.
log
(
formatLog
(
'
registerApp
'
)
);
}
appCtx
=
appVm
;
appCtx
.
$vm
=
appVm
;
...
...
@@ -6386,7 +6386,7 @@ var serviceContext = (function (vue) {
callback
,
};
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`nextNavigator:
${
path
}
${
msg
}
`
);
console
.
log
(
formatLog
(
'
setPendingNavigator
'
,
path
,
msg
)
);
}
}
function
navigate
(
path
,
callback
,
isAppLaunch
)
{
...
...
@@ -6421,7 +6421,7 @@ var serviceContext = (function (vue) {
}
const
{
callback
}
=
pendingNavigator
;
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`pendingNavigate:
${
pendingNavigator
.
path
}
`
);
console
.
log
(
formatLog
(
'
pendingNavigate
'
,
pendingNavigator
.
path
)
);
}
pendingNavigator
=
false
;
return
callback
();
...
...
@@ -6439,7 +6439,7 @@ var serviceContext = (function (vue) {
// 创建预加载
const
preloadWebview
=
createPreloadWebview
();
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`navigateFinish.preloadWebview:
${
preloadWebview
.
id
}
`
);
console
.
log
(
formatLog
(
'
navigateFinish
'
,
'
preloadWebview
'
,
preloadWebview
.
id
)
);
}
if
(
!
pendingNavigator
)
{
return
;
...
...
@@ -6457,12 +6457,12 @@ var serviceContext = (function (vue) {
delay
=
webview
.
nvue
?
0
:
100
;
}
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`[show][
${
Date
.
now
()}
]`
,
delay
);
console
.
log
(
formatLog
(
'
showWebview
'
,
'
delay
'
,
delay
)
);
}
const
execShowCallback
=
function
()
{
if
(
execShowCallback
.
_called
)
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
'
execShowCallback.prevent
'
);
console
.
log
(
formatLog
(
'
execShowCallback
'
,
'
prevent
'
)
);
}
return
;
}
...
...
@@ -6474,13 +6474,13 @@ var serviceContext = (function (vue) {
setTimeout
(()
=>
{
const
timer
=
setTimeout
(()
=>
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`[show.callback.timer][
${
Date
.
now
()}
]`
);
console
.
log
(
formatLog
(
'
showWebview
'
,
'
callback
'
,
'
timer
'
)
);
}
execShowCallback
();
},
animationDuration
+
150
);
webview
.
show
(
animationType
,
animationDuration
,
()
=>
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`[show.callback][
${
Date
.
now
()}
]`
);
console
.
log
(
formatLog
(
'
showWebview
'
,
'
callback
'
)
);
}
if
(
!
execShowCallback
.
_called
)
{
clearTimeout
(
timer
);
...
...
@@ -6624,7 +6624,7 @@ var serviceContext = (function (vue) {
const
oldSetup
=
component
.
setup
;
component
.
setup
=
(
_props
,
ctx
)
=>
{
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`
${
pagePath
}
setup`
);
console
.
log
(
formatLog
(
pagePath
,
'
setup
'
)
);
}
const
instance
=
vue
.
getCurrentInstance
();
const
pageVm
=
instance
.
proxy
;
...
...
@@ -6713,7 +6713,7 @@ var serviceContext = (function (vue) {
tabBar$1
.
append
(
webview
);
}
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`[uni-app] registerPage(
${
path
}
,
${
webview
.
id
}
)`
);
console
.
log
(
formatLog
(
'
registerPage
'
,
path
,
webview
.
id
)
);
}
initWebview
(
webview
,
path
,
query
,
routeOptions
.
meta
);
const
route
=
path
.
substr
(
1
);
...
...
@@ -6895,7 +6895,7 @@ var serviceContext = (function (vue) {
function
publishHandler
(
event
,
args
,
pageIds
)
{
args
=
JSON
.
stringify
(
args
);
if
((
process
.
env
.
NODE_ENV
!==
'
production
'
))
{
console
.
log
(
`UNIAPP[publishHandler]:[
${
+
new
Date
()}
]`
,
event
,
args
,
pageIds
);
console
.
log
(
formatLog
(
'
publishHandler
'
,
event
,
args
,
pageIds
)
);
}
if
(
!
isArray
(
pageIds
))
{
pageIds
=
[
pageIds
];
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
7b45cf53
...
...
@@ -5286,6 +5286,9 @@
})(
dist
);
var
wrapper
=
/* @__PURE__ */
getDefaultExportFromCjs
(
dist
.
exports
);
var
button
=
"
uni-button {
\n
position: relative;
\n
display: block;
\n
margin-left: auto;
\n
margin-right: auto;
\n
padding-left: 14px;
\n
padding-right: 14px;
\n
box-sizing: border-box;
\n
font-size: 18px;
\n
text-align: center;
\n
text-decoration: none;
\n
line-height: 2.55555556;
\n
border-radius: 5px;
\n
-webkit-tap-highlight-color: transparent;
\n
overflow: hidden;
\n
color: #000000;
\n
background-color: #f8f8f8;
\n
cursor: pointer;
\n
}
\n\n
uni-button[hidden] {
\n
display: none !important;
\n
}
\n\n
uni-button:after {
\n
content: ' ';
\n
width: 200%;
\n
height: 200%;
\n
position: absolute;
\n
top: 0;
\n
left: 0;
\n
border: 1px solid rgba(0, 0, 0, 0.2);
\n
transform: scale(0.5);
\n
transform-origin: 0 0;
\n
box-sizing: border-box;
\n
border-radius: 10px;
\n
}
\n\n
uni-button[native] {
\n
padding-left: 0;
\n
padding-right: 0;
\n
}
\n\n
uni-button[native] .uni-button-cover-view-wrapper {
\n
border: inherit;
\n
border-color: inherit;
\n
border-radius: inherit;
\n
background-color: inherit;
\n
}
\n\n
uni-button[native] .uni-button-cover-view-inner {
\n
padding-left: 14px;
\n
padding-right: 14px;
\n
}
\n\n
uni-button uni-cover-view {
\n
line-height: inherit;
\n
white-space: inherit;
\n
}
\n\n
uni-button[type='default'] {
\n
color: #000000;
\n
background-color: #f8f8f8;
\n
}
\n\n
uni-button[type='primary'] {
\n
color: #ffffff;
\n
background-color: #007aff;
\n
}
\n\n
uni-button[type='warn'] {
\n
color: #ffffff;
\n
background-color: #e64340;
\n
}
\n\n
uni-button[disabled] {
\n
color: rgba(255, 255, 255, 0.6);
\n
cursor: not-allowed;
\n
}
\n\n
uni-button[disabled][type='default'],
\n
uni-button[disabled]:not([type]) {
\n
color: rgba(0, 0, 0, 0.3);
\n
background-color: #f7f7f7;
\n
}
\n\n
uni-button[disabled][type='primary'] {
\n
background-color: rgba(0, 122, 255, 0.6);
\n
}
\n\n
uni-button[disabled][type='warn'] {
\n
background-color: #ec8b89;
\n
}
\n\n
uni-button[type='primary'][plain] {
\n
color: #007aff;
\n
border: 1px solid #007aff;
\n
background-color: transparent;
\n
}
\n\n
uni-button[type='primary'][plain][disabled] {
\n
color: rgba(0, 0, 0, 0.2);
\n
border-color: rgba(0, 0, 0, 0.2);
\n
}
\n\n
uni-button[type='primary'][plain]:after {
\n
border-width: 0;
\n
}
\n\n
uni-button[type='default'][plain] {
\n
color: #353535;
\n
border: 1px solid #353535;
\n
background-color: transparent;
\n
}
\n\n
uni-button[type='default'][plain][disabled] {
\n
color: rgba(0, 0, 0, 0.2);
\n
border-color: rgba(0, 0, 0, 0.2);
\n
}
\n\n
uni-button[type='default'][plain]:after {
\n
border-width: 0;
\n
}
\n\n
uni-button[plain] {
\n
color: #353535;
\n
border: 1px solid #353535;
\n
background-color: transparent;
\n
}
\n\n
uni-button[plain][disabled] {
\n
color: rgba(0, 0, 0, 0.2);
\n
border-color: rgba(0, 0, 0, 0.2);
\n
}
\n\n
uni-button[plain]:after {
\n
border-width: 0;
\n
}
\n\n
uni-button[plain][native] .uni-button-cover-view-inner {
\n
padding: 0;
\n
}
\n\n
uni-button[type='warn'][plain] {
\n
color: #e64340;
\n
border: 1px solid #e64340;
\n
background-color: transparent;
\n
}
\n\n
uni-button[type='warn'][plain][disabled] {
\n
color: rgba(0, 0, 0, 0.2);
\n
border-color: rgba(0, 0, 0, 0.2);
\n
}
\n\n
uni-button[type='warn'][plain]:after {
\n
border-width: 0;
\n
}
\n\n
uni-button[size='mini'] {
\n
display: inline-block;
\n
line-height: 2.3;
\n
font-size: 13px;
\n
padding: 0 1.34em;
\n
}
\n\n
uni-button[size='mini'][native] {
\n
padding: 0;
\n
}
\n\n
uni-button[size='mini'][native] .uni-button-cover-view-inner {
\n
padding: 0 1.34em;
\n
}
\n\n
uni-button[loading]:not([disabled]) {
\n
cursor: progress;
\n
}
\n\n
uni-button[loading]:before {
\n
content: ' ';
\n
display: inline-block;
\n
width: 18px;
\n
height: 18px;
\n
vertical-align: middle;
\n
animation: uni-loading 1s steps(12, end) infinite;
\n
background-size: 100%;
\n
}
\n\n
uni-button[loading][type='primary'] {
\n
color: rgba(255, 255, 255, 0.6);
\n
background-color: #0062cc;
\n
}
\n\n
uni-button[loading][type='primary'][plain] {
\n
color: #007aff;
\n
background-color: transparent;
\n
}
\n\n
uni-button[loading][type='default'] {
\n
color: rgba(0, 0, 0, 0.6);
\n
background-color: #dedede;
\n
}
\n\n
uni-button[loading][type='default'][plain] {
\n
color: #353535;
\n
background-color: transparent;
\n
}
\n\n
uni-button[loading][type='warn'] {
\n
color: rgba(255, 255, 255, 0.6);
\n
background-color: #ce3c39;
\n
}
\n\n
uni-button[loading][type='warn'][plain] {
\n
color: #e64340;
\n
background-color: transparent;
\n
}
\n\n
uni-button[loading][native]:before {
\n
content: none;
\n
}
\n\n
.button-hover {
\n
color: rgba(0, 0, 0, 0.6);
\n
background-color: #dedede;
\n
}
\n\n
.button-hover[plain] {
\n
color: rgba(53, 53, 53, 0.6);
\n
border-color: rgba(53, 53, 53, 0.6);
\n
background-color: transparent;
\n
}
\n\n
.button-hover[type='primary'] {
\n
color: rgba(255, 255, 255, 0.6);
\n
background-color: #0062cc;
\n
}
\n\n
.button-hover[type='primary'][plain] {
\n
color: rgba(26, 173, 25, 0.6);
\n
border-color: rgba(26, 173, 25, 0.6);
\n
background-color: transparent;
\n
}
\n\n
.button-hover[type='default'] {
\n
color: rgba(0, 0, 0, 0.6);
\n
background-color: #dedede;
\n
}
\n\n
.button-hover[type='default'][plain] {
\n
color: rgba(53, 53, 53, 0.6);
\n
border-color: rgba(53, 53, 53, 0.6);
\n
background-color: transparent;
\n
}
\n\n
.button-hover[type='warn'] {
\n
color: rgba(255, 255, 255, 0.6);
\n
background-color: #ce3c39;
\n
}
\n\n
.button-hover[type='warn'][plain] {
\n
color: rgba(230, 67, 64, 0.6);
\n
border-color: rgba(230, 67, 64, 0.6);
\n
background-color: transparent;
\n
}
\n
"
;
function
formatLog
(
module
,
...
args
)
{
return
`[
${
Date
.
now
()}
][
${
module
}
]\uFF1A
${
args
.
map
((
arg
)
=>
JSON
.
stringify
(
arg
)).
join
(
"
"
)}
`
;
}
function
getCustomDataset
(
el
)
{
return
extend
({},
el
.
dataset
,
el
.
__uniDataset
);
}
...
...
@@ -5627,11 +5630,11 @@
unsubscribe
(
event
,
callback
)
{
emitter
.
off
(
`
${
subscribeNamespace
}
.
${
event
}
`
,
callback
);
},
subscribeHandler
(
event
,
args
,
pageId
)
{
subscribeHandler
(
event
,
args
,
pageId
2
)
{
{
console
.
log
(
`[subscribeHandler][
${
Date
.
now
()}
]:
${
subscribeNamespace
}
.
${
event
}
,
${
JSON
.
stringify
(
args
)}
,
${
pageId
}
`
);
console
.
log
(
formatLog
(
subscribeNamespace
,
"
subscribeHandler
"
,
pageId2
,
event
,
args
)
);
}
emitter
.
emit
(
`
${
subscribeNamespace
}
.
${
event
}
`
,
args
,
pageId
);
emitter
.
emit
(
`
${
subscribeNamespace
}
.
${
event
}
`
,
args
,
pageId
2
);
}
};
}
...
...
@@ -5943,7 +5946,7 @@
});
}
function
_addListeners
(
id
,
listeners
,
watch2
)
{
const
pageId
=
useCurrentPageId
();
const
pageId
2
=
useCurrentPageId
();
if
(
watch2
&&
!
id
)
{
return
;
}
...
...
@@ -5953,19 +5956,19 @@
Object
.
keys
(
listeners
).
forEach
((
name
)
=>
{
if
(
watch2
)
{
if
(
name
.
indexOf
(
"
@
"
)
!==
0
&&
name
.
indexOf
(
"
uni-
"
)
!==
0
)
{
UniViewJSBridge
.
on
(
`uni-
${
name
}
-
${
pageId
}
-
${
id
}
`
,
listeners
[
name
]);
UniViewJSBridge
.
on
(
`uni-
${
name
}
-
${
pageId
2
}
-
${
id
}
`
,
listeners
[
name
]);
}
}
else
{
if
(
name
.
indexOf
(
"
uni-
"
)
===
0
)
{
UniViewJSBridge
.
on
(
name
,
listeners
[
name
]);
}
else
if
(
id
)
{
UniViewJSBridge
.
on
(
`uni-
${
name
}
-
${
pageId
}
-
${
id
}
`
,
listeners
[
name
]);
UniViewJSBridge
.
on
(
`uni-
${
name
}
-
${
pageId
2
}
-
${
id
}
`
,
listeners
[
name
]);
}
}
});
}
function
_removeListeners
(
id
,
listeners
,
watch2
)
{
const
pageId
=
useCurrentPageId
();
const
pageId
2
=
useCurrentPageId
();
if
(
watch2
&&
!
id
)
{
return
;
}
...
...
@@ -5975,13 +5978,13 @@
Object
.
keys
(
listeners
).
forEach
((
name
)
=>
{
if
(
watch2
)
{
if
(
name
.
indexOf
(
"
@
"
)
!==
0
&&
name
.
indexOf
(
"
uni-
"
)
!==
0
)
{
UniViewJSBridge
.
off
(
`uni-
${
name
}
-
${
pageId
}
-
${
id
}
`
,
listeners
[
name
]);
UniViewJSBridge
.
off
(
`uni-
${
name
}
-
${
pageId
2
}
-
${
id
}
`
,
listeners
[
name
]);
}
}
else
{
if
(
name
.
indexOf
(
"
uni-
"
)
===
0
)
{
UniViewJSBridge
.
off
(
name
,
listeners
[
name
]);
}
else
if
(
id
)
{
UniViewJSBridge
.
off
(
`uni-
${
name
}
-
${
pageId
}
-
${
id
}
`
,
listeners
[
name
]);
UniViewJSBridge
.
off
(
`uni-
${
name
}
-
${
pageId
2
}
-
${
id
}
`
,
listeners
[
name
]);
}
}
});
...
...
@@ -6593,10 +6596,13 @@
const
UniViewJSBridge$1
=
/* @__PURE__ */
extend
(
ViewJSBridge
,
{
publishHandler
});
let
pageId
;
function
publishHandler
(
event
,
args
=
{})
{
const
pageId
=
plus
.
webview
.
currentWebview
().
id
;
if
(
!
pageId
)
{
pageId
=
plus
.
webview
.
currentWebview
().
id
;
}
{
console
.
log
(
`[
VIEW][
${
Date
.
now
()}
]:`
,
event
,
args
,
pageId
);
console
.
log
(
`[
${
Date
.
now
()}
][View]: `
+
pageId
+
"
"
+
event
+
"
"
+
JSON
.
stringify
(
args
)
);
}
plus
.
webview
.
postMessageToUniNView
({
type
:
"
subscribeHandler
"
,
...
...
packages/uni-app-plus/src/helpers/plus.ts
浏览文件 @
7b45cf53
import
{
extend
}
from
'
@vue/shared
'
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
getRouteOptions
}
from
'
@dcloudio/uni-core
'
interface
PlusResult
extends
Record
<
string
,
any
>
{
code
?:
number
...
...
@@ -103,7 +104,7 @@ export function isTabBarPage(path = '') {
return
route
&&
route
.
meta
.
isTabBar
}
catch
(
e
)
{
if
(
__DEV__
)
{
console
.
log
(
'
getCurrentPages is not ready
'
)
console
.
error
(
formatLog
(
'
isTabBarPage
'
,
e
)
)
}
}
return
false
...
...
packages/uni-app-plus/src/service/api/location/getLocation.ts
浏览文件 @
7b45cf53
...
...
@@ -15,11 +15,6 @@ function getLocationSuccess(
)
{
const
coords
=
position
.
coords
if
(
type
!==
position
.
coordsType
)
{
if
(
__DEV__
)
{
console
.
log
(
`UNIAPP[location]:before[
${
position
.
coordsType
}
][lng:
${
coords
.
longitude
}
,lat:
${
coords
.
latitude
}
]`
)
}
let
coordArray
if
(
type
===
'
wgs84
'
)
{
coordArray
=
gcj02towgs84
(
coords
.
longitude
,
coords
.
latitude
)
...
...
@@ -29,11 +24,6 @@ function getLocationSuccess(
if
(
coordArray
)
{
coords
.
longitude
=
coordArray
[
0
]
coords
.
latitude
=
coordArray
[
1
]
if
(
__DEV__
)
{
console
.
log
(
`UNIAPP[location]:after[
${
type
}
][lng:
${
coords
.
longitude
}
,lat:
${
coords
.
latitude
}
]`
)
}
}
}
...
...
packages/uni-app-plus/src/service/api/route/utils.ts
浏览文件 @
7b45cf53
import
{
getRouteMeta
}
from
'
@dcloudio/uni-core
'
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
createPreloadWebview
,
onWebviewReady
,
...
...
@@ -20,7 +21,7 @@ function setPendingNavigator(path: string, callback: Function, msg: string) {
callback
,
}
if
(
__DEV__
)
{
console
.
log
(
`nextNavigator:
${
path
}
${
msg
}
`
)
console
.
log
(
formatLog
(
'
setPendingNavigator
'
,
path
,
msg
)
)
}
}
...
...
@@ -68,7 +69,7 @@ function pendingNavigate() {
}
const
{
callback
}
=
pendingNavigator
if
(
__DEV__
)
{
console
.
log
(
`pendingNavigate:
${
pendingNavigator
.
path
}
`
)
console
.
log
(
formatLog
(
'
pendingNavigate
'
,
pendingNavigator
.
path
)
)
}
pendingNavigator
=
false
return
callback
()
...
...
@@ -87,7 +88,9 @@ export function navigateFinish() {
// 创建预加载
const
preloadWebview
=
createPreloadWebview
()
if
(
__DEV__
)
{
console
.
log
(
`navigateFinish.preloadWebview:
${
preloadWebview
.
id
}
`
)
console
.
log
(
formatLog
(
'
navigateFinish
'
,
'
preloadWebview
'
,
preloadWebview
.
id
)
)
}
if
(
!
pendingNavigator
)
{
return
...
...
packages/uni-app-plus/src/service/api/route/webview.ts
浏览文件 @
7b45cf53
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
navigateFinish
}
from
'
./utils
'
export
function
closeWebview
(
...
...
@@ -23,12 +24,12 @@ export function showWebview(
}
if
(
__DEV__
)
{
console
.
log
(
`[show][
${
Date
.
now
()}
]`
,
delay
)
console
.
log
(
formatLog
(
'
showWebview
'
,
'
delay
'
,
delay
)
)
}
const
execShowCallback
=
function
()
{
if
(
execShowCallback
.
_called
)
{
if
(
__DEV__
)
{
console
.
log
(
'
execShowCallback.prevent
'
)
console
.
log
(
formatLog
(
'
execShowCallback
'
,
'
prevent
'
)
)
}
return
}
...
...
@@ -40,14 +41,14 @@ export function showWebview(
setTimeout
(()
=>
{
const
timer
=
setTimeout
(()
=>
{
if
(
__DEV__
)
{
console
.
log
(
`[show.callback.timer][
${
Date
.
now
()}
]`
)
console
.
log
(
formatLog
(
'
showWebview
'
,
'
callback
'
,
'
timer
'
)
)
}
execShowCallback
()
},
animationDuration
+
150
)
webview
.
show
(
animationType
as
any
,
animationDuration
,
()
=>
{
if
(
__DEV__
)
{
console
.
log
(
`[show.callback][
${
Date
.
now
()}
]`
)
console
.
log
(
formatLog
(
'
showWebview
'
,
'
callback
'
)
)
}
if
(
!
execShowCallback
.
_called
)
{
clearTimeout
(
timer
)
...
...
packages/uni-app-plus/src/service/bridge/index.ts
浏览文件 @
7b45cf53
import
{
extend
,
isArray
}
from
'
@vue/shared
'
import
{
ServiceJSBridge
}
from
'
@dcloudio/uni-core
'
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
export
const
UniServiceJSBridge
=
/*#__PURE__*/
extend
(
ServiceJSBridge
,
{
publishHandler
,
...
...
@@ -13,7 +14,7 @@ function publishHandler(
)
{
args
=
JSON
.
stringify
(
args
)
if
(
__DEV__
)
{
console
.
log
(
`UNIAPP[publishHandler]:[
${
+
new
Date
()}
]`
,
event
,
args
,
pageIds
)
console
.
log
(
formatLog
(
'
publishHandler
'
,
event
,
args
,
pageIds
)
)
}
if
(
!
isArray
(
pageIds
))
{
pageIds
=
[
pageIds
]
...
...
packages/uni-app-plus/src/service/framework/app/index.ts
浏览文件 @
7b45cf53
import
{
ComponentPublicInstance
}
from
'
vue
'
import
{
extend
}
from
'
@vue/shared
'
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
initService
}
from
'
@dcloudio/uni-core
'
import
{
initEntry
}
from
'
./initEntry
'
...
...
@@ -31,7 +31,7 @@ export function getApp({ allowDefault = false } = {}) {
export
function
registerApp
(
appVm
:
ComponentPublicInstance
)
{
if
(
__DEV__
)
{
console
.
log
(
'
registerApp
'
)
console
.
log
(
formatLog
(
'
registerApp
'
)
)
}
appCtx
=
appVm
appCtx
.
$vm
=
appVm
...
...
packages/uni-app-plus/src/service/framework/app/initGlobalEvent.ts
浏览文件 @
7b45cf53
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
backbuttonListener
}
from
'
./utils
'
export
function
initGlobalEvent
()
{
...
...
@@ -42,7 +43,7 @@ function subscribePlusMessage({
data
:
{
type
:
string
;
args
:
Record
<
string
,
any
>
}
})
{
if
(
__DEV__
)
{
console
.
log
(
'
plusMessage:
'
+
JSON
.
stringify
(
data
))
console
.
log
(
formatLog
(
'
plusMessage
'
,
data
))
}
if
(
data
&&
data
.
type
)
{
UniServiceJSBridge
.
subscribeHandler
(
'
plusMessage.
'
+
data
.
type
,
data
.
args
)
...
...
packages/uni-app-plus/src/service/framework/page/register.ts
浏览文件 @
7b45cf53
import
{
hasOwn
}
from
'
@vue/shared
'
import
{
NAVBAR_HEIGHT
,
ON_REACH_BOTTOM_DISTANCE
}
from
'
@dcloudio/uni-shared
'
import
{
formatLog
,
NAVBAR_HEIGHT
,
ON_REACH_BOTTOM_DISTANCE
,
}
from
'
@dcloudio/uni-shared
'
import
{
initEntry
}
from
'
../app/initEntry
'
import
{
initRouteOptions
}
from
'
./routeOptions
'
import
{
createWebview
,
initWebview
}
from
'
../webview
'
...
...
@@ -60,7 +64,7 @@ export function registerPage({
}
if
(
__DEV__
)
{
console
.
log
(
`[uni-app] registerPage(
${
path
}
,
${
webview
.
id
}
)`
)
console
.
log
(
formatLog
(
'
registerPage
'
,
path
,
webview
.
id
)
)
}
initWebview
(
webview
,
path
,
query
,
routeOptions
.
meta
)
...
...
packages/uni-app-plus/src/service/framework/page/setup.ts
浏览文件 @
7b45cf53
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
ComponentPublicInstance
,
getCurrentInstance
}
from
'
vue
'
import
{
PageProps
,
VueComponent
}
from
'
./define
'
import
{
addCurrentPage
}
from
'
./getCurrentPages
'
...
...
@@ -9,7 +10,7 @@ export function setupPage(
const
oldSetup
=
component
.
setup
component
.
setup
=
(
_props
,
ctx
)
=>
{
if
(
__DEV__
)
{
console
.
log
(
`
${
pagePath
}
setup`
)
console
.
log
(
formatLog
(
pagePath
,
'
setup
'
)
)
}
const
instance
=
getCurrentInstance
()
!
const
pageVm
=
instance
.
proxy
!
...
...
packages/uni-app-plus/src/service/framework/webview/init/event/close.ts
浏览文件 @
7b45cf53
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
export
function
onWebviewClose
(
webview
:
PlusWebviewWebviewObject
)
{
const
{
popupSubNVueWebviews
}
=
webview
as
any
if
(
!
popupSubNVueWebviews
)
{
...
...
@@ -7,7 +9,13 @@ export function onWebviewClose(webview: PlusWebviewWebviewObject) {
Object
.
keys
(
popupSubNVueWebviews
).
forEach
((
id
)
=>
{
if
(
__DEV__
)
{
console
.
log
(
`UNIAPP[webview][
${
webview
.
id
}
]:popupSubNVueWebview[
${
id
}
].close`
formatLog
(
'
onWebviewClose
'
,
webview
.
id
,
'
popupSubNVueWebview
'
,
id
,
'
close
'
)
)
}
popupSubNVueWebviews
[
id
].
close
(
'
none
'
)
...
...
packages/uni-app-plus/src/service/framework/webview/init/style.ts
浏览文件 @
7b45cf53
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
parseWebviewStyle
}
from
'
../style
'
import
{
initUniPageUrl
,
initDebugRefresh
}
from
'
../utils
'
...
...
@@ -17,7 +18,7 @@ export function initWebviewStyle(
webviewStyle
.
isTab
=
isTabBar
}
if
(
__DEV__
)
{
console
.
log
(
'
[uni-app] updateWebview
'
,
webviewStyle
)
console
.
log
(
formatLog
(
'
updateWebview
'
,
webviewStyle
)
)
}
webview
.
setStyle
(
webviewStyle
)
}
packages/uni-app-plus/src/service/framework/webview/nvue.ts
浏览文件 @
7b45cf53
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
extend
}
from
'
@vue/shared
'
import
{
CreateWebviewOptions
}
from
'
.
'
...
...
@@ -14,7 +15,9 @@ export function createNVueWebview({
const
curWebviewStyle
=
parseWebviewStyle
(
path
,
routeOptions
.
meta
)
;(
curWebviewStyle
as
any
).
uniPageUrl
=
initUniPageUrl
(
path
,
query
)
if
(
__DEV__
)
{
console
.
log
(
'
[uni-app] createWebview
'
,
curWebviewId
,
path
,
curWebviewStyle
)
console
.
log
(
formatLog
(
'
createNVueWebview
'
,
curWebviewId
,
path
,
curWebviewStyle
)
)
}
// android 需要使用
;(
curWebviewStyle
as
any
).
isTab
=
!!
routeOptions
.
meta
.
isTabBar
...
...
packages/uni-app-plus/src/service/framework/webview/preload.ts
浏览文件 @
7b45cf53
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
{
VIEW_WEBVIEW_PATH
}
from
'
../../constants
'
import
{
genWebviewId
}
from
'
./utils
'
...
...
@@ -18,7 +19,7 @@ export function createPreloadWebview() {
String
(
genWebviewId
())
)
if
(
__DEV__
)
{
console
.
log
(
`[uni-app] preloadWebview[
${
preloadWebview
.
id
}
]`
)
console
.
log
(
formatLog
(
'
createPreloadWebview
'
,
preloadWebview
.
id
)
)
}
}
return
preloadWebview
...
...
packages/uni-app-plus/src/view/bridge/index.ts
浏览文件 @
7b45cf53
...
...
@@ -8,10 +8,20 @@ export const UniViewJSBridge = /*#__PURE__*/ extend(ViewJSBridge, {
publishHandler
,
})
let
pageId
:
string
function
publishHandler
(
event
:
string
,
args
:
unknown
=
{})
{
const
pageId
=
plus
.
webview
.
currentWebview
().
id
if
(
!
pageId
)
{
pageId
=
plus
.
webview
.
currentWebview
().
id
!
}
if
(
__DEV__
)
{
console
.
log
(
`[VIEW][
${
Date
.
now
()}
]:`
,
event
,
args
,
pageId
)
console
.
log
(
`[
${
Date
.
now
()}
][View]: `
+
pageId
+
'
'
+
event
+
'
'
+
JSON
.
stringify
(
args
)
)
}
;(
plus
.
webview
as
any
).
postMessageToUniNView
(
{
...
...
packages/uni-core/src/helpers/bridge.ts
浏览文件 @
7b45cf53
// TODO 等待 vue3 的兼容模式自带emitter
import
{
formatLog
}
from
'
@dcloudio/uni-shared
'
import
E
from
'
./TinyEmitter
'
export
function
initBridge
(
...
...
@@ -28,9 +29,7 @@ export function initBridge(
subscribeHandler
(
event
:
string
,
args
:
unknown
,
pageId
?:
number
):
void
{
if
(
__DEV__
)
{
console
.
log
(
`[subscribeHandler][
${
Date
.
now
()}
]:
${
subscribeNamespace
}
.
${
event
}
,
${
JSON
.
stringify
(
args
)}
,
${
pageId
}
`
formatLog
(
subscribeNamespace
,
'
subscribeHandler
'
,
pageId
,
event
,
args
)
)
}
emitter
.
emit
(
`
${
subscribeNamespace
}
.
${
event
}
`
,
args
,
pageId
)
...
...
packages/uni-h5/dist/uni-h5.cjs.js
浏览文件 @
7b45cf53
...
...
@@ -374,7 +374,7 @@ function initBridge(subscribeNamespace) {
},
subscribeHandler
(
event
,
args
,
pageId
)
{
if
(
process
.
env
.
NODE_ENV
!==
"
production
"
)
{
console
.
log
(
`[subscribeHandler][
${
Date
.
now
()}
]:
${
subscribeNamespace
}
.
${
event
}
,
${
JSON
.
stringify
(
args
)}
,
${
pageId
}
`
);
console
.
log
(
uniShared
.
formatLog
(
subscribeNamespace
,
"
subscribeHandler
"
,
pageId
,
event
,
args
)
);
}
emitter
.
emit
(
`
${
subscribeNamespace
}
.
${
event
}
`
,
args
,
pageId
);
}
...
...
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
7b45cf53
import { isFunction, extend, isString, hyphenate, isPlainObject, isArray, hasOwn, isObject, capitalize, toRawType, makeMap as makeMap$1, isPromise, invokeArrayFns as invokeArrayFns$1 } from "@vue/shared";
import { once, passive, initCustomDataset, invokeArrayFns, normalizeTarget, isBuiltInComponent, SCHEME_RE, DATA_RE, getCustomDataset, callOptions, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, NAVBAR_HEIGHT, parseQuery, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, updateElementStyle, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime } from "@dcloudio/uni-shared";
import { once,
formatLog,
passive, initCustomDataset, invokeArrayFns, normalizeTarget, isBuiltInComponent, SCHEME_RE, DATA_RE, getCustomDataset, callOptions, PRIMARY_COLOR, removeLeadingSlash, getLen, debounce, NAVBAR_HEIGHT, parseQuery, ON_REACH_BOTTOM_DISTANCE, decodedQuery, WEB_INVOKE_APPSERVICE, updateElementStyle, parseUrl, addFont, scrollTo, RESPONSIVE_MIN_WIDTH, formatDateTime } from "@dcloudio/uni-shared";
import { openBlock, createBlock, mergeProps, createVNode, toDisplayString, withModifiers, getCurrentInstance, defineComponent, ref, provide, computed, watch, onUnmounted, inject, onBeforeUnmount, reactive, onActivated, onMounted, nextTick, onBeforeMount, withDirectives, vShow, shallowRef, watchEffect, isVNode, Fragment, markRaw, createTextVNode, injectHook, onBeforeActivate, onBeforeDeactivate, renderList, onDeactivated, createApp, Transition, withCtx, KeepAlive, resolveDynamicComponent, renderSlot } from "vue";
import { initVueI18n, LOCALE_EN, LOCALE_ES, LOCALE_FR, LOCALE_ZH_HANS, LOCALE_ZH_HANT } from "@dcloudio/uni-i18n";
import { useRoute, createRouter, createWebHistory, createWebHashHistory, useRouter, isNavigationFailure, RouterView } from "vue-router";
...
...
@@ -463,7 +463,7 @@ function initBridge(subscribeNamespace) {
},
subscribeHandler(event, args, pageId) {
if (process.env.NODE_ENV !== "production") {
console.log(
`[subscribeHandler][${Date.now()}]:${subscribeNamespace}.${event}, ${JSON.stringify(args)}, ${pageId}`
);
console.log(
formatLog(subscribeNamespace, "subscribeHandler", pageId, event, args)
);
}
emitter2.emit(`${subscribeNamespace}.${event}`, args, pageId);
}
...
...
packages/uni-mp-alipay/src/runtime/createComponent.ts
浏览文件 @
7b45cf53
...
...
@@ -71,7 +71,7 @@ function initVm(
// 父组件已经初始化,直接初始化子,否则放到父组件的 didMount 中处理
// 初始化 vue 实例
mpInstance
.
$vm
=
createComponent
(
relationOptions
.
parent
)
handleRef
.
call
(
relationOptions
.
parent
.
$scope
,
mpInstance
)
handleRef
.
call
(
relationOptions
.
parent
.
$scope
as
any
,
mpInstance
)
initChildVues
(
mpInstance
)
mpInstance
.
$vm
.
$callHook
(
'
mounted
'
)
}
...
...
packages/uni-mp-alipay/src/runtime/util.ts
浏览文件 @
7b45cf53
...
...
@@ -109,7 +109,7 @@ export function initChildVues(
initSpecialMethods
(
childMPInstance
)
if
(
relationOptions
.
parent
)
{
handleRef
.
call
(
relationOptions
.
parent
.
$scope
,
childMPInstance
)
handleRef
.
call
(
relationOptions
.
parent
.
$scope
as
any
,
childMPInstance
)
}
initChildVues
(
childMPInstance
)
...
...
packages/uni-mp-core/src/index.ts
浏览文件 @
7b45cf53
declare
module
'
@vue/runtime-core
'
{
interface
ComponentCustomProperties
{
$scope
:
WechatMiniprogram
.
App
.
Instance
<
any
>
$vm
:
ComponentPublicInstance
globalData
:
Record
<
string
,
any
>
$callHook
:
(
hook
:
string
,
args
?:
unknown
)
=>
unknown
...
...
packages/uni-shared/dist/uni-shared.cjs.js
浏览文件 @
7b45cf53
...
...
@@ -4,6 +4,12 @@ Object.defineProperty(exports, '__esModule', { value: true });
var
shared
=
require
(
'
@vue/shared
'
);
function
formatLog
(
module
,
...
args
)
{
return
`[
${
Date
.
now
()}
][
${
module
}
]:
${
args
.
map
((
arg
)
=>
JSON
.
stringify
(
arg
))
.
join
(
'
'
)}
`
;
}
function
formatKey
(
key
)
{
return
shared
.
camelize
(
key
.
substring
(
5
));
}
...
...
@@ -943,6 +949,7 @@ exports.defaultRpx2Unit = defaultRpx2Unit;
exports
.
encodeAttr
=
encodeAttr
;
exports
.
encodeTag
=
encodeTag
;
exports
.
formatDateTime
=
formatDateTime
;
exports
.
formatLog
=
formatLog
;
exports
.
getCustomDataset
=
getCustomDataset
;
exports
.
getEnvLocale
=
getEnvLocale
;
exports
.
getLen
=
getLen
;
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
7b45cf53
...
...
@@ -62,6 +62,8 @@ export declare function formatDateTime({ date, mode }: {
mode
?:
string
|
undefined
;
}):
string
;
export
declare
function
formatLog
(
module
:
string
,
...
args
:
any
[]):
string
;
export
declare
function
getCustomDataset
(
el
:
HTMLElement
|
HTMLElementWithDataset
):
DOMStringMap
&
Record
<
string
,
any
>
;
export
declare
function
getEnvLocale
():
string
;
...
...
packages/uni-shared/dist/uni-shared.es.js
浏览文件 @
7b45cf53
import
{
camelize
,
extend
,
isString
,
isPlainObject
,
isArray
,
isHTMLTag
,
isSVGTag
,
capitalize
}
from
'
@vue/shared
'
;
function
formatLog
(
module
,
...
args
)
{
return
`[
${
Date
.
now
()}
][
${
module
}
]:
${
args
.
map
((
arg
)
=>
JSON
.
stringify
(
arg
))
.
join
(
'
'
)}
`
;
}
function
formatKey
(
key
)
{
return
camelize
(
key
.
substring
(
5
));
}
...
...
@@ -892,4 +898,4 @@ function getEnvLocale() {
return
(
lang
&&
lang
.
replace
(
/
[
.:
]
.*/
,
''
))
||
'
en
'
;
}
export
{
BACKGROUND_COLOR
,
BUILT_IN_TAGS
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
ON_REACH_BOTTOM_DISTANCE
,
PLUS_RE
,
PRIMARY_COLOR
,
RESPONSIVE_MIN_WIDTH
,
SCHEME_RE
,
SELECTED_COLOR
,
TABBAR_HEIGHT
,
TAGS
,
UNI_SSR
,
UNI_SSR_DATA
,
UNI_SSR_GLOBAL_DATA
,
UNI_SSR_STORE
,
UNI_SSR_TITLE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
addFont
,
cache
,
cacheStringFunction
,
callOptions
,
createRpx2Unit
,
debounce
,
decode
,
decodeAttr
,
decodeTag
,
decodedQuery
,
defaultRpx2Unit
,
encodeAttr
,
encodeTag
,
formatDateTime
,
getCustomDataset
,
getEnvLocale
,
getLen
,
initCustomDataset
,
invokeArrayFns
,
isBuiltInComponent
,
isCustomElement
,
isNativeTag
,
isServiceCustomElement
,
isServiceNativeTag
,
normalizeDataset
,
normalizeTarget
,
once
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
export
{
BACKGROUND_COLOR
,
BUILT_IN_TAGS
,
COMPONENT_NAME_PREFIX
,
COMPONENT_PREFIX
,
COMPONENT_SELECTOR_PREFIX
,
DATA_RE
,
NAVBAR_HEIGHT
,
NODE_TYPE_COMMENT
,
NODE_TYPE_ELEMENT
,
NODE_TYPE_PAGE
,
NODE_TYPE_TEXT
,
ON_REACH_BOTTOM_DISTANCE
,
PLUS_RE
,
PRIMARY_COLOR
,
RESPONSIVE_MIN_WIDTH
,
SCHEME_RE
,
SELECTED_COLOR
,
TABBAR_HEIGHT
,
TAGS
,
UNI_SSR
,
UNI_SSR_DATA
,
UNI_SSR_GLOBAL_DATA
,
UNI_SSR_STORE
,
UNI_SSR_TITLE
,
UniBaseNode
,
UniCommentNode
,
UniElement
,
UniEvent
,
UniInputElement
,
UniNode
,
UniTextAreaElement
,
UniTextNode
,
WEB_INVOKE_APPSERVICE
,
addFont
,
cache
,
cacheStringFunction
,
callOptions
,
createRpx2Unit
,
debounce
,
decode
,
decodeAttr
,
decodeTag
,
decodedQuery
,
defaultRpx2Unit
,
encodeAttr
,
encodeTag
,
formatDateTime
,
formatLog
,
getCustomDataset
,
getEnvLocale
,
getLen
,
initCustomDataset
,
invokeArrayFns
,
isBuiltInComponent
,
isCustomElement
,
isNativeTag
,
isServiceCustomElement
,
isServiceNativeTag
,
normalizeDataset
,
normalizeTarget
,
once
,
parseQuery
,
parseUrl
,
passive
,
plusReady
,
removeLeadingSlash
,
sanitise
,
scrollTo
,
stringifyQuery
,
updateElementStyle
};
packages/uni-shared/src/index.ts
浏览文件 @
7b45cf53
export
*
from
'
./log
'
export
*
from
'
./dom
'
export
*
from
'
./url
'
export
*
from
'
./plus
'
...
...
packages/uni-shared/src/log.ts
0 → 100644
浏览文件 @
7b45cf53
export
function
formatLog
(
module
:
string
,
...
args
:
any
[])
{
return
`[
${
Date
.
now
()}
][
${
module
}
]:
${
args
.
map
((
arg
)
=>
JSON
.
stringify
(
arg
))
.
join
(
'
'
)}
`
}
packages/vite-plugin-uni/bin/uni.js
浏览文件 @
7b45cf53
...
...
@@ -23,4 +23,4 @@ if (debugIndex > 0) {
}
}
}
require
(
'
../dist/cli
'
)
require
(
'
../dist/cli
/index.js
'
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录