Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
我本凡人 一念云泥
uni-app
提交
10064323
uni-app
项目概览
我本凡人 一念云泥
/
uni-app
与 Fork 源项目一致
Fork自
DCloud / uni-app
通知
4
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
uni-app
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
10064323
编写于
10月 22, 2019
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
build v3 service
上级
f5fa4b19
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
45 addition
and
28 deletion
+45
-28
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+45
-28
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
10064323
...
@@ -3838,17 +3838,19 @@ var serviceContext = (function () {
...
@@ -3838,17 +3838,19 @@ var serviceContext = (function () {
* 动态设置 tabBar 某一项的内容
* 动态设置 tabBar 某一项的内容
*/
*/
function
setTabBarItem$1
(
index
,
text
,
iconPath
,
selectedIconPath
)
{
function
setTabBarItem$1
(
index
,
text
,
iconPath
,
selectedIconPath
)
{
const
item
=
{};
const
item
=
{
index
};
if
(
text
!==
undefined
)
{
item
.
text
=
text
;
}
if
(
iconPath
)
{
if
(
iconPath
)
{
item
.
iconPath
=
getRealPath$1
(
iconPath
);
item
.
iconPath
=
getRealPath$1
(
iconPath
);
}
}
if
(
selectedIconPath
)
{
if
(
selectedIconPath
)
{
item
.
selectedIconPath
=
getRealPath$1
(
selectedIconPath
);
item
.
selectedIconPath
=
getRealPath$1
(
selectedIconPath
);
}
}
tabBar
&&
tabBar
.
setTabBarItem
(
Object
.
assign
({
tabBar
&&
tabBar
.
setTabBarItem
(
item
);
index
,
text
},
item
));
}
}
/**
/**
* 动态设置 tabBar 的整体样式
* 动态设置 tabBar 的整体样式
...
@@ -7056,12 +7058,27 @@ var serviceContext = (function () {
...
@@ -7056,12 +7058,27 @@ var serviceContext = (function () {
errMsg
:
'
setTabBarStyle:fail not TabBar page
'
errMsg
:
'
setTabBarStyle:fail not TabBar page
'
}
}
}
}
tabBar$1
.
setTabBarStyle
({
const
style
=
{};
color
,
const
borderStyles
=
{
selectedColor
,
black
:
'
rgba(0,0,0,0.4)
'
,
backgroundColor
,
white
:
'
rgba(255,255,255,0.4)
'
borderStyle
:
borderStyle
===
'
white
'
?
'
#ffffff
'
:
'
#c6c6c6
'
};
});
if
(
color
)
{
style
.
color
=
color
;
}
if
(
selectedColor
)
{
style
.
selectedColor
=
selectedColor
;
}
if
(
backgroundColor
)
{
style
.
backgroundColor
=
backgroundColor
;
}
if
(
borderStyle
in
borderStyles
)
{
borderStyle
=
borderStyles
[
borderStyle
];
}
if
(
borderStyle
)
{
style
.
borderStyle
=
borderStyle
;
}
tabBar$1
.
setTabBarStyle
(
style
);
return
{
return
{
errMsg
:
'
setTabBarStyle:ok
'
errMsg
:
'
setTabBarStyle:ok
'
}
}
...
@@ -8994,7 +9011,7 @@ var serviceContext = (function () {
...
@@ -8994,7 +9011,7 @@ var serviceContext = (function () {
}
}
const
handleVdData
=
{
const
handleVdData
=
{
[
UI_EVENT
]:
function
onUIEvent
(
vdBatchEvent
,
vd
)
{
[
UI_EVENT
]:
function
onUIEvent
(
vdBatchEvent
,
vd
)
{
vdBatchEvent
.
forEach
(([
cid
,
nid
,
event
])
=>
{
vdBatchEvent
.
forEach
(([
cid
,
nid
,
event
])
=>
{
console
.
log
(
`[EVENT]`
,
cid
,
nid
,
event
);
console
.
log
(
`[EVENT]`
,
cid
,
nid
,
event
);
event
.
preventDefault
=
noop
;
event
.
preventDefault
=
noop
;
...
@@ -9008,14 +9025,14 @@ var serviceContext = (function () {
...
@@ -9008,14 +9025,14 @@ var serviceContext = (function () {
}
}
};
};
function
onVdSync$1
(
vdBatchData
,
vd
)
{
function
onVdSync$1
(
vdBatchData
,
vd
)
{
vdBatchData
.
forEach
(([
type
,
vdData
])
=>
{
vdBatchData
.
forEach
(([
type
,
vdData
])
=>
{
handleVdData
[
type
](
vdData
,
vd
);
handleVdData
[
type
](
vdData
,
vd
);
});
});
}
}
class
VDomSync
{
class
VDomSync
{
constructor
(
pageId
,
pagePath
)
{
constructor
(
pageId
,
pagePath
)
{
this
.
pageId
=
pageId
;
this
.
pageId
=
pageId
;
this
.
pagePath
=
pagePath
;
this
.
pagePath
=
pagePath
;
this
.
batchData
=
[];
this
.
batchData
=
[];
...
@@ -9027,47 +9044,47 @@ var serviceContext = (function () {
...
@@ -9027,47 +9044,47 @@ var serviceContext = (function () {
this
.
_init
();
this
.
_init
();
}
}
_init
()
{
_init
()
{
registerVdSync
(
this
.
pageId
,
(
vdBatchData
)
=>
{
registerVdSync
(
this
.
pageId
,
(
vdBatchData
)
=>
{
onVdSync$1
(
vdBatchData
,
this
);
onVdSync$1
(
vdBatchData
,
this
);
});
});
}
}
addMountedVm
(
vm
)
{
addMountedVm
(
vm
)
{
vm
.
_$mounted
();
// 触发vd数据同步
vm
.
_$mounted
();
// 触发vd数据同步
this
.
addVdSyncCallback
(
function
mounted
()
{
this
.
addVdSyncCallback
(
function
mounted
()
{
vm
.
__call_hook
(
'
mounted
'
);
vm
.
__call_hook
(
'
mounted
'
);
});
});
}
}
addUpdatedVm
(
vm
)
{
addUpdatedVm
(
vm
)
{
vm
.
_$updated
();
// 触发vd数据同步
vm
.
_$updated
();
// 触发vd数据同步
this
.
addVdSyncCallback
(
function
mounted
()
{
this
.
addVdSyncCallback
(
function
mounted
()
{
vm
.
__call_hook
(
'
updated
'
);
vm
.
__call_hook
(
'
updated
'
);
});
});
}
}
addVdSyncCallback
(
callback
)
{
addVdSyncCallback
(
callback
)
{
isFn
(
callback
)
&&
vdSyncCallbacks
.
push
(
callback
);
isFn
(
callback
)
&&
vdSyncCallbacks
.
push
(
callback
);
}
}
getVm
(
id
)
{
getVm
(
id
)
{
return
this
.
vms
[
id
]
return
this
.
vms
[
id
]
}
}
addVm
(
vm
)
{
addVm
(
vm
)
{
this
.
vms
[
vm
.
_$id
]
=
vm
;
this
.
vms
[
vm
.
_$id
]
=
vm
;
}
}
removeVm
(
vm
)
{
removeVm
(
vm
)
{
delete
this
.
vms
[
vm
.
_$id
];
delete
this
.
vms
[
vm
.
_$id
];
}
}
addElement
(
elm
)
{
addElement
(
elm
)
{
this
.
elements
.
indexOf
(
elm
)
===
-
1
&&
this
.
elements
.
push
(
elm
);
this
.
elements
.
indexOf
(
elm
)
===
-
1
&&
this
.
elements
.
push
(
elm
);
}
}
removeElement
(
elm
)
{
removeElement
(
elm
)
{
const
elmIndex
=
this
.
elements
.
indexOf
(
elm
);
const
elmIndex
=
this
.
elements
.
indexOf
(
elm
);
if
(
elmIndex
===
-
1
)
{
if
(
elmIndex
===
-
1
)
{
return
console
.
error
(
`removeElement[
${
elm
.
cid
}
][
${
elm
.
nid
}
] not found`
)
return
console
.
error
(
`removeElement[
${
elm
.
cid
}
][
${
elm
.
nid
}
] not found`
)
...
@@ -9075,11 +9092,11 @@ var serviceContext = (function () {
...
@@ -9075,11 +9092,11 @@ var serviceContext = (function () {
this
.
elements
.
splice
(
elmIndex
,
1
);
this
.
elements
.
splice
(
elmIndex
,
1
);
}
}
push
(
type
,
cid
,
data
)
{
push
(
type
,
cid
,
data
)
{
this
.
batchData
.
push
([
type
,
[
cid
,
data
]]);
this
.
batchData
.
push
([
type
,
[
cid
,
data
]]);
}
}
flush
()
{
flush
()
{
if
(
!
this
.
initialized
)
{
if
(
!
this
.
initialized
)
{
this
.
initialized
=
true
;
this
.
initialized
=
true
;
this
.
batchData
.
push
([
PAGE_CREATED
,
[
this
.
pageId
,
this
.
pagePath
]]);
this
.
batchData
.
push
([
PAGE_CREATED
,
[
this
.
pageId
,
this
.
pagePath
]]);
...
@@ -9095,7 +9112,7 @@ var serviceContext = (function () {
...
@@ -9095,7 +9112,7 @@ var serviceContext = (function () {
}
}
}
}
destroy
()
{
destroy
()
{
this
.
batchData
.
length
=
0
;
this
.
batchData
.
length
=
0
;
this
.
vms
=
Object
.
create
(
null
);
this
.
vms
=
Object
.
create
(
null
);
this
.
initialized
=
false
;
this
.
initialized
=
false
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录