Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MuGuiLin
uni-app
提交
cc56e43e
U
uni-app
项目概览
MuGuiLin
/
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,发现更多精彩内容 >>
提交
cc56e43e
编写于
2月 25, 2022
作者:
fxy060608
浏览文件
操作
浏览文件
下载
差异文件
chore: merge
上级
dd6e1c97
98c9007d
变更
9
隐藏空白更改
内联
并排
Showing
9 changed file
with
64 addition
and
23 deletion
+64
-23
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+14
-8
packages/uni-app-plus/dist/uni.runtime.esm.js
packages/uni-app-plus/dist/uni.runtime.esm.js
+3
-0
packages/uni-app-plus/src/service/framework/dom/Page.ts
packages/uni-app-plus/src/service/framework/dom/Page.ts
+3
-0
packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts
...pp-plus/src/view/framework/dom/components/UniComponent.ts
+1
-1
packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts
...ni-app-plus/src/view/framework/dom/elements/UniElement.ts
+12
-9
packages/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
...s/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
+10
-2
packages/uni-app-plus/src/view/framework/dom/index.ts
packages/uni-app-plus/src/view/framework/dom/index.ts
+5
-1
packages/uni-shared/dist/uni-shared.d.ts
packages/uni-shared/dist/uni-shared.d.ts
+8
-1
packages/uni-shared/src/vdom/Action.ts
packages/uni-shared/src/vdom/Action.ts
+8
-1
未找到文件。
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
cc56e43e
...
...
@@ -12201,7 +12201,10 @@
setText(text2) {
this.$.textContent = text2;
}
insert(parentNodeId, refNodeId) {
insert(parentNodeId, refNodeId, nodeJson) {
if (nodeJson) {
this.init(nodeJson, false);
}
var node = this.$;
var parentNode = $(parentNodeId);
if (refNodeId === -1) {
...
...
@@ -12450,6 +12453,7 @@
this.insert(parentNodeId, refNodeId);
}
init(nodeJson) {
var isCreate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true;
if (hasOwn$1(nodeJson, "a")) {
this.setAttrs(nodeJson.a);
}
...
...
@@ -12463,12 +12467,14 @@
this.addWxsEvents(nodeJson.w);
}
super.init(nodeJson);
watch(this.$props, () => {
queuePostActionJob(this._update, JOB_PRIORITY_UPDATE);
}, {
flush: "sync"
});
this.update(true);
if (isCreate) {
watch(this.$props, () => {
queuePostActionJob(this._update, JOB_PRIORITY_UPDATE);
}, {
flush: "sync"
});
this.update(true);
}
}
setAttrs(attrs2) {
this.setWxsProps(attrs2);
...
...
@@ -22901,7 +22907,7 @@
var parentNodeId = action[3];
return createElement(action[1], getDict(action[2]), parentNodeId === -1 ? 0 : parentNodeId, action[4], decodeNodeJson(getDict, action[5]));
case ACTION_TYPE_INSERT:
return $(action[1]).insert(action[2], action[3]);
return $(action[1]).insert(action[2], action[3]
, decodeNodeJson(getDict, action[4])
);
case ACTION_TYPE_REMOVE:
return $(action[1]).remove();
case ACTION_TYPE_SET_ATTRIBUTE:
...
...
packages/uni-app-plus/dist/uni.runtime.esm.js
浏览文件 @
cc56e43e
...
...
@@ -17947,6 +17947,9 @@ class UniPageNode extends UniNode {
}
else {
// 部分手机上,create 和 insert 可能不在同一批次,被分批发送
if (extras) {
action[4] = extras;
}
this.updateActions.push(action);
// if ((process.env.NODE_ENV !== 'production')) {
// console.error(formatLog(`Insert`, action, 'not found createAction'))
...
...
packages/uni-app-plus/src/service/framework/dom/Page.ts
浏览文件 @
cc56e43e
...
...
@@ -213,6 +213,9 @@ export default class UniPageNode extends UniNode implements IUniPageNode {
}
}
else
{
// 部分手机上,create 和 insert 可能不在同一批次,被分批发送
if
(
extras
)
{
action
[
4
]
=
extras
as
UniNodeJSON
}
this
.
updateActions
.
push
(
action
)
// if (__DEV__) {
// console.error(formatLog(`Insert`, action, 'not found createAction'))
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts
浏览文件 @
cc56e43e
...
...
@@ -71,7 +71,7 @@ export class UniComponent extends UniNode {
// 延迟到insert之后,再flush,确保mounted等生命周期触发正常
flushPostFlushCbs
()
}
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
,
isCreate
:
boolean
=
true
)
{
const
{
a
,
e
,
w
}
=
nodeJson
if
(
a
)
{
// 初始化时,先提取 wxsProps,再 setAttr
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts
浏览文件 @
cc56e43e
...
...
@@ -45,7 +45,7 @@ export class UniElement<T extends object> extends UniNode {
this
.
init
(
nodeJson
)
this
.
insert
(
parentNodeId
,
refNodeId
)
}
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
,
isCreate
:
boolean
=
true
)
{
if
(
hasOwn
(
nodeJson
,
'
a
'
))
{
this
.
setAttrs
(
nodeJson
.
a
!
)
}
...
...
@@ -59,14 +59,17 @@ export class UniElement<T extends object> extends UniNode {
this
.
addWxsEvents
(
nodeJson
.
w
!
)
}
super
.
init
(
nodeJson
)
watch
(
this
.
$props
,
()
=>
{
queuePostActionJob
(
this
.
_update
!
,
JOB_PRIORITY_UPDATE
)
},
{
flush
:
'
sync
'
}
)
this
.
update
(
true
)
// insert 的时候可能也会调用该 init
if
(
isCreate
)
{
watch
(
this
.
$props
,
()
=>
{
queuePostActionJob
(
this
.
_update
!
,
JOB_PRIORITY_UPDATE
)
},
{
flush
:
'
sync
'
}
)
this
.
update
(
true
)
}
}
setAttrs
(
attrs
:
Record
<
string
,
any
>
)
{
// 初始化时,先提取 wxsProps,再 setAttr
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
浏览文件 @
cc56e43e
...
...
@@ -36,7 +36,7 @@ export class UniNode {
parent
.
appendUniChild
(
this
)
}
}
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
,
isCreate
:
boolean
=
true
)
{
if
(
hasOwn
(
nodeJson
,
'
t
'
))
{
this
.
$
.
textContent
=
nodeJson
.
t
as
string
}
...
...
@@ -44,7 +44,15 @@ export class UniNode {
setText
(
text
:
string
)
{
this
.
$
.
textContent
=
text
}
insert
(
parentNodeId
:
number
,
refNodeId
:
number
)
{
insert
(
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
?:
Partial
<
UniNodeJSON
>
)
{
// 部分性能低的手机,create 和 insert 是分开的,而 nodeJson 可能随着 insert
if
(
nodeJson
)
{
this
.
init
(
nodeJson
,
false
)
}
const
node
=
this
.
$
const
parentNode
=
$
(
parentNodeId
)
if
(
refNodeId
===
-
1
)
{
...
...
packages/uni-app-plus/src/view/framework/dom/index.ts
浏览文件 @
cc56e43e
...
...
@@ -68,7 +68,11 @@ function onPageUpdateSync(actions: (PageAction | DictAction)[]) {
decodeNodeJson
(
getDict
,
action
[
5
]
as
UniNodeJSONMinify
)
)
case
ACTION_TYPE_INSERT
:
return
$
(
action
[
1
]).
insert
(
action
[
2
],
action
[
3
])
return
$
(
action
[
1
]).
insert
(
action
[
2
],
action
[
3
],
decodeNodeJson
(
getDict
,
action
[
4
]
as
UniNodeJSONMinify
)
)
case
ACTION_TYPE_REMOVE
:
return
$
(
action
[
1
]).
remove
()
case
ACTION_TYPE_SET_ATTRIBUTE
:
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
cc56e43e
...
...
@@ -240,8 +240,15 @@ export declare const initCustomDatasetOnce: () => void;
* nodeId
* parentNodeId
* refNodeId
* nodeJson
*/
export
declare
type
InsertAction
=
[
typeof
ACTION_TYPE_INSERT
,
number
,
number
,
number
];
export
declare
type
InsertAction
=
[
typeof
ACTION_TYPE_INSERT
,
number
,
number
,
number
,
Partial
<
UniNodeJSON
|
UniNodeJSONMinify
>
?
];
export
declare
const
invokeArrayFns
:
(
fns
:
Function
[],
arg
?:
any
)
=>
any
;
...
...
packages/uni-shared/src/vdom/Action.ts
浏览文件 @
cc56e43e
...
...
@@ -58,8 +58,15 @@ export type CreateAction = [
* nodeId
* parentNodeId
* refNodeId
* nodeJson
*/
export
type
InsertAction
=
[
typeof
ACTION_TYPE_INSERT
,
number
,
number
,
number
]
export
type
InsertAction
=
[
typeof
ACTION_TYPE_INSERT
,
number
,
number
,
number
,
Partial
<
UniNodeJSON
|
UniNodeJSONMinify
>
?
]
/**
* nodeId
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录