Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wkj001
uni-app
提交
e8f11e25
U
uni-app
项目概览
wkj001
/
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,发现更多精彩内容 >>
提交
e8f11e25
编写于
10月 19, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(v3): JSON.stringify(undefined=>'')
上级
c34022d8
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
39 addition
and
1386 deletion
+39
-1386
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+31
-29
packages/uni-app-plus/dist/view.css
packages/uni-app-plus/dist/view.css
+1
-1353
packages/uni-app-plus/dist/view.umd.min.js
packages/uni-app-plus/dist/view.umd.min.js
+2
-2
packages/vue-cli-plugin-uni/lib/env.js
packages/vue-cli-plugin-uni/lib/env.js
+2
-1
src/platforms/app-plus/service/publish-handler.js
src/platforms/app-plus/service/publish-handler.js
+3
-1
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
e8f11e25
...
...
@@ -8557,7 +8557,9 @@ var serviceContext = (function () {
});
function
publishHandler
(
eventType
,
args
,
pageIds
)
{
args
=
JSON
.
stringify
(
args
);
args
=
JSON
.
stringify
(
args
,
(
k
,
v
)
=>
{
// 将 undefined 格式化为空字符串
return
typeof
v
===
'
undefined
'
?
''
:
v
});
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`UNIAPP[publishHandler]:[
${
+
new
Date
()}
]`
,
eventType
,
args
,
pageIds
);
}
...
...
@@ -8949,12 +8951,12 @@ var serviceContext = (function () {
};
}
function
noop
()
{}
function
noop
()
{}
const
callbacks$a
=
[];
// 数据同步 callback
class
VDomSync
{
constructor
(
pageId
,
pagePath
)
{
constructor
(
pageId
,
pagePath
)
{
this
.
pageId
=
pageId
;
this
.
pagePath
=
pagePath
;
this
.
batchData
=
[];
...
...
@@ -8966,7 +8968,7 @@ var serviceContext = (function () {
this
.
_init
();
}
_init
()
{
_init
()
{
UniServiceJSBridge
.
subscribe
(
VD_SYNC_CALLBACK
,
()
=>
{
const
copies
=
callbacks$a
.
slice
(
0
);
callbacks$a
.
length
=
0
;
...
...
@@ -8993,43 +8995,43 @@ var serviceContext = (function () {
});
}
addMountedVm
(
vm
)
{
addMountedVm
(
vm
)
{
vm
.
_$mounted
();
// 触发vd数据同步
this
.
addCallback
(
function
mounted
()
{
this
.
addCallback
(
function
mounted
()
{
vm
.
__call_hook
(
'
mounted
'
);
});
}
addUpdatedVm
(
vm
)
{
addUpdatedVm
(
vm
)
{
vm
.
_$updated
();
// 触发vd数据同步
this
.
addCallback
(
function
mounted
()
{
this
.
addCallback
(
function
mounted
()
{
vm
.
__call_hook
(
'
updated
'
);
});
}
addCallback
(
callback
)
{
addCallback
(
callback
)
{
isFn
(
callback
)
&&
callbacks$a
.
push
(
callback
);
}
getVm
(
id
)
{
getVm
(
id
)
{
return
this
.
vms
[
id
]
}
addVm
(
vm
)
{
addVm
(
vm
)
{
this
.
vms
[
vm
.
_$id
]
=
vm
;
}
removeVm
(
vm
)
{
removeVm
(
vm
)
{
delete
this
.
vms
[
vm
.
_$id
];
}
addEvent
(
cid
,
nid
,
name
,
handler
)
{
addEvent
(
cid
,
nid
,
name
,
handler
)
{
const
cHandlers
=
this
.
handlers
[
cid
]
||
(
this
.
handlers
[
cid
]
=
Object
.
create
(
null
));
const
nHandlers
=
cHandlers
[
nid
]
||
(
cHandlers
[
nid
]
=
Object
.
create
(
null
));
(
nHandlers
[
name
]
||
(
nHandlers
[
name
]
=
[])).
push
(
handler
);
}
removeEvent
(
cid
,
nid
,
name
,
handler
)
{
removeEvent
(
cid
,
nid
,
name
,
handler
)
{
const
cHandlers
=
this
.
handlers
[
cid
]
||
(
this
.
handlers
[
cid
]
=
Object
.
create
(
null
));
const
nHandlers
=
cHandlers
[
nid
]
||
(
cHandlers
[
nid
]
=
Object
.
create
(
null
));
const
eHandlers
=
nHandlers
[
name
];
...
...
@@ -9041,11 +9043,11 @@ var serviceContext = (function () {
}
}
push
(
type
,
nodeId
,
data
)
{
push
(
type
,
nodeId
,
data
)
{
this
.
batchData
.
push
([
type
,
[
nodeId
,
data
]]);
}
flush
()
{
flush
()
{
if
(
!
this
.
initialized
)
{
this
.
initialized
=
true
;
this
.
batchData
.
push
([
PAGE_CREATED
,
[
this
.
pageId
,
this
.
pagePath
]]);
...
...
@@ -9061,7 +9063,7 @@ var serviceContext = (function () {
}
}
destroy
()
{
destroy
()
{
this
.
batchData
.
length
=
0
;
this
.
vms
=
Object
.
create
(
null
);
this
.
initialized
=
false
;
...
...
@@ -9099,17 +9101,17 @@ var serviceContext = (function () {
return
result
}
function
initData
(
Vue
)
{
function
initData
(
Vue
)
{
Vue
.
prototype
.
_$s
=
setData
;
Vue
.
prototype
.
_$i
=
setIfData
;
Vue
.
prototype
.
_$f
=
setForData
;
Vue
.
prototype
.
_$e
=
setElseIfData
;
Vue
.
prototype
.
_$setData
=
function
setData
(
type
,
data
)
{
Vue
.
prototype
.
_$setData
=
function
setData
(
type
,
data
)
{
this
.
_$vd
.
push
(
type
,
this
.
_$id
,
data
);
};
Vue
.
prototype
.
_$mounted
=
function
mounted
()
{
Vue
.
prototype
.
_$mounted
=
function
mounted
()
{
if
(
!
this
.
_$vd
)
{
return
}
...
...
@@ -9122,7 +9124,7 @@ var serviceContext = (function () {
}
};
Vue
.
prototype
.
_$updated
=
function
updated
()
{
Vue
.
prototype
.
_$updated
=
function
updated
()
{
if
(
!
this
.
_$vd
)
{
return
}
...
...
@@ -9133,13 +9135,13 @@ var serviceContext = (function () {
};
Object
.
defineProperty
(
Vue
.
prototype
,
'
_$vd
'
,
{
get
()
{
get
()
{
return
this
.
$root
.
_$vdomSync
}
});
Vue
.
mixin
({
beforeCreate
()
{
beforeCreate
()
{
if
(
this
.
$options
.
mpType
)
{
this
.
mpType
=
this
.
$options
.
mpType
;
}
...
...
@@ -9160,7 +9162,7 @@ var serviceContext = (function () {
this
.
_$newData
=
Object
.
create
(
null
);
}
},
beforeUpdate
()
{
beforeUpdate
()
{
if
(
!
this
.
_$vd
)
{
return
}
...
...
@@ -9169,7 +9171,7 @@ var serviceContext = (function () {
console
.
log
(
`[
${
this
.
_$id
}
] beforeUpdate `
+
Date
.
now
());
this
.
_$newData
=
Object
.
create
(
null
);
},
beforeDestroy
()
{
beforeDestroy
()
{
if
(
!
this
.
_$vd
)
{
return
}
...
...
@@ -9179,7 +9181,7 @@ var serviceContext = (function () {
});
}
function
setData
(
id
,
name
,
value
)
{
function
setData
(
id
,
name
,
value
)
{
const
diffData
=
this
.
_$newData
[
id
]
||
(
this
.
_$newData
[
id
]
=
{});
if
(
typeof
name
!==
'
string
'
)
{
...
...
@@ -9195,7 +9197,7 @@ var serviceContext = (function () {
return
(
diffData
[
name
]
=
value
)
}
function
setForData
(
id
,
value
)
{
function
setForData
(
id
,
value
)
{
const
diffData
=
this
.
_$newData
[
id
]
||
(
this
.
_$newData
[
id
]
=
{});
const
vForData
=
diffData
[
'
v-for
'
]
||
(
diffData
[
'
v-for
'
]
=
[]);
...
...
@@ -9216,11 +9218,11 @@ var serviceContext = (function () {
return
key
}
function
setIfData
(
id
,
value
)
{
function
setIfData
(
id
,
value
)
{
return
((
this
.
_$newData
[
id
]
||
(
this
.
_$newData
[
id
]
=
{}))[
'
v-if
'
]
=
value
)
}
function
setElseIfData
(
id
,
value
)
{
function
setElseIfData
(
id
,
value
)
{
return
((
this
.
_$newData
[
id
]
||
(
this
.
_$newData
[
id
]
=
{}))[
'
v-else-if
'
]
=
value
)
}
...
...
packages/uni-app-plus/dist/view.css
浏览文件 @
e8f11e25
此差异已折叠。
点击以展开。
packages/uni-app-plus/dist/view.umd.min.js
浏览文件 @
e8f11e25
此差异已折叠。
点击以展开。
packages/vue-cli-plugin-uni/lib/env.js
浏览文件 @
e8f11e25
...
...
@@ -119,7 +119,8 @@ if (process.env.UNI_PLATFORM === 'app-plus') {
)
{
process
.
env
.
UNI_USING_V3
=
true
platformOptions
.
usingComponents
=
true
process
.
env
.
UNI_OUTPUT_TMP_DIR
=
''
process
.
env
.
UNI_OUTPUT_TMP_DIR
=
''
isNVueCompiler
=
true
// v3 目前仅支持 uni-app 模式
}
if
(
platformOptions
.
nvueCompiler
===
'
uni-app
'
)
{
...
...
src/platforms/app-plus/service/publish-handler.js
浏览文件 @
e8f11e25
export
function
publishHandler
(
eventType
,
args
,
pageIds
)
{
args
=
JSON
.
stringify
(
args
)
args
=
JSON
.
stringify
(
args
,
(
k
,
v
)
=>
{
// 将 undefined 格式化为空字符串
return
typeof
v
===
'
undefined
'
?
''
:
v
})
if
(
process
.
env
.
NODE_ENV
!==
'
production
'
)
{
console
.
log
(
`UNIAPP[publishHandler]:[
${
+
new
Date
()}
]`
,
eventType
,
args
,
pageIds
)
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录