Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
陈庄旺
uni-app
提交
5ec7a426
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,发现更多精彩内容 >>
提交
5ec7a426
编写于
7月 23, 2021
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor(app): vdom
上级
2dbb687e
变更
62
展开全部
隐藏空白更改
内联
并排
Showing
62 changed file
with
469 addition
and
305 deletion
+469
-305
packages/uni-app-plus/__tests__/service/dom/__snapshots__/dom.spec.ts.snap
...plus/__tests__/service/dom/__snapshots__/dom.spec.ts.snap
+4
-4
packages/uni-app-plus/__tests__/service/dom/dom.spec.ts
packages/uni-app-plus/__tests__/service/dom/dom.spec.ts
+14
-14
packages/uni-app-plus/dist/tools.umd.js
packages/uni-app-plus/dist/tools.umd.js
+2
-1
packages/uni-app-plus/dist/uni-app-service.es.js
packages/uni-app-plus/dist/uni-app-service.es.js
+28
-22
packages/uni-app-plus/dist/uni-app-view.umd.js
packages/uni-app-plus/dist/uni-app-view.umd.js
+173
-158
packages/uni-app-plus/src/service/framework/dom/Page.ts
packages/uni-app-plus/src/service/framework/dom/Page.ts
+13
-3
packages/uni-app-plus/src/view/framework/dom/components/UniAd.ts
...s/uni-app-plus/src/view/framework/dom/components/UniAd.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniAudio.ts
...ni-app-plus/src/view/framework/dom/components/UniAudio.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniButton.ts
...i-app-plus/src/view/framework/dom/components/UniButton.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniCamera.ts
...i-app-plus/src/view/framework/dom/components/UniCamera.ts
+2
-2
packages/uni-app-plus/src/view/framework/dom/components/UniCanvas.ts
...i-app-plus/src/view/framework/dom/components/UniCanvas.ts
+10
-1
packages/uni-app-plus/src/view/framework/dom/components/UniCheckbox.ts
...app-plus/src/view/framework/dom/components/UniCheckbox.ts
+2
-0
packages/uni-app-plus/src/view/framework/dom/components/UniCheckboxGroup.ts
...lus/src/view/framework/dom/components/UniCheckboxGroup.ts
+9
-1
packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts
...pp-plus/src/view/framework/dom/components/UniComponent.ts
+49
-21
packages/uni-app-plus/src/view/framework/dom/components/UniCoverImage.ts
...p-plus/src/view/framework/dom/components/UniCoverImage.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniCoverView.ts
...pp-plus/src/view/framework/dom/components/UniCoverView.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniEditor.ts
...i-app-plus/src/view/framework/dom/components/UniEditor.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniForm.ts
...uni-app-plus/src/view/framework/dom/components/UniForm.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniFunctionalPageNavigator.ts
...ew/framework/dom/components/UniFunctionalPageNavigator.ts
+2
-2
packages/uni-app-plus/src/view/framework/dom/components/UniIcon.ts
...uni-app-plus/src/view/framework/dom/components/UniIcon.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniImage.ts
...ni-app-plus/src/view/framework/dom/components/UniImage.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniInput.ts
...ni-app-plus/src/view/framework/dom/components/UniInput.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniLabel.ts
...ni-app-plus/src/view/framework/dom/components/UniLabel.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniLivePlayer.ts
...p-plus/src/view/framework/dom/components/UniLivePlayer.ts
+2
-2
packages/uni-app-plus/src/view/framework/dom/components/UniLivePusher.ts
...p-plus/src/view/framework/dom/components/UniLivePusher.ts
+2
-2
packages/uni-app-plus/src/view/framework/dom/components/UniMap.ts
.../uni-app-plus/src/view/framework/dom/components/UniMap.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniMovableArea.ts
...-plus/src/view/framework/dom/components/UniMovableArea.ts
+9
-1
packages/uni-app-plus/src/view/framework/dom/components/UniMovableView.ts
...-plus/src/view/framework/dom/components/UniMovableView.ts
+9
-1
packages/uni-app-plus/src/view/framework/dom/components/UniNavigator.ts
...pp-plus/src/view/framework/dom/components/UniNavigator.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniOfficialAccount.ts
...s/src/view/framework/dom/components/UniOfficialAccount.ts
+2
-2
packages/uni-app-plus/src/view/framework/dom/components/UniOpenData.ts
...app-plus/src/view/framework/dom/components/UniOpenData.ts
+2
-2
packages/uni-app-plus/src/view/framework/dom/components/UniPicker.ts
...i-app-plus/src/view/framework/dom/components/UniPicker.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniPickerView.ts
...p-plus/src/view/framework/dom/components/UniPickerView.ts
+2
-0
packages/uni-app-plus/src/view/framework/dom/components/UniPickerViewColumn.ts
.../src/view/framework/dom/components/UniPickerViewColumn.ts
+2
-0
packages/uni-app-plus/src/view/framework/dom/components/UniProgress.ts
...app-plus/src/view/framework/dom/components/UniProgress.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniRadio.ts
...ni-app-plus/src/view/framework/dom/components/UniRadio.ts
+10
-1
packages/uni-app-plus/src/view/framework/dom/components/UniRadioGroup.ts
...p-plus/src/view/framework/dom/components/UniRadioGroup.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniRichText.ts
...app-plus/src/view/framework/dom/components/UniRichText.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniScrollView.ts
...p-plus/src/view/framework/dom/components/UniScrollView.ts
+2
-0
packages/uni-app-plus/src/view/framework/dom/components/UniSlider.ts
...i-app-plus/src/view/framework/dom/components/UniSlider.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniSwiper.ts
...i-app-plus/src/view/framework/dom/components/UniSwiper.ts
+2
-0
packages/uni-app-plus/src/view/framework/dom/components/UniSwiperItem.ts
...p-plus/src/view/framework/dom/components/UniSwiperItem.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniSwitch.ts
...i-app-plus/src/view/framework/dom/components/UniSwitch.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniTextarea.ts
...app-plus/src/view/framework/dom/components/UniTextarea.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniVideo.ts
...ni-app-plus/src/view/framework/dom/components/UniVideo.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/components/UniWebView.ts
...-app-plus/src/view/framework/dom/components/UniWebView.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/decodeActions.ts
...ages/uni-app-plus/src/view/framework/dom/decodeActions.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/elements/UniComment.ts
...ni-app-plus/src/view/framework/dom/elements/UniComment.ts
+2
-1
packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts
...ni-app-plus/src/view/framework/dom/elements/UniElement.ts
+2
-0
packages/uni-app-plus/src/view/framework/dom/elements/UniHoverElement.ts
...p-plus/src/view/framework/dom/elements/UniHoverElement.ts
+6
-5
packages/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
...s/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
+1
-1
packages/uni-app-plus/src/view/framework/dom/elements/UniTextElement.ts
...pp-plus/src/view/framework/dom/elements/UniTextElement.ts
+3
-1
packages/uni-app-plus/src/view/framework/dom/elements/UniTextNode.ts
...i-app-plus/src/view/framework/dom/elements/UniTextNode.ts
+2
-0
packages/uni-app-plus/src/view/framework/dom/elements/UniTodoNode.ts
...i-app-plus/src/view/framework/dom/elements/UniTodoNode.ts
+7
-1
packages/uni-app-plus/src/view/framework/dom/elements/UniViewElement.ts
...pp-plus/src/view/framework/dom/elements/UniViewElement.ts
+8
-1
packages/uni-app-plus/src/view/framework/dom/index.ts
packages/uni-app-plus/src/view/framework/dom/index.ts
+5
-4
packages/uni-app-plus/src/view/framework/dom/page.ts
packages/uni-app-plus/src/view/framework/dom/page.ts
+4
-2
packages/uni-app-vue/dist/view.runtime.esm.js
packages/uni-app-vue/dist/view.runtime.esm.js
+4
-4
packages/uni-app-vue/lib/view.runtime.esm.js
packages/uni-app-vue/lib/view.runtime.esm.js
+4
-4
packages/uni-h5/dist/uni-h5.es.js
packages/uni-h5/dist/uni-h5.es.js
+17
-17
packages/uni-shared/dist/uni-shared.d.ts
packages/uni-shared/dist/uni-shared.d.ts
+2
-0
packages/uni-shared/src/vdom/Action.ts
packages/uni-shared/src/vdom/Action.ts
+2
-0
未找到文件。
packages/uni-app-plus/__tests__/service/dom/__snapshots__/dom.spec.ts.snap
浏览文件 @
5ec7a426
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`dom minify = true 1`] = `"[[0,[\\"VIEW\\",\\"id\\",\\"view\\",\\"hidden\\",true]],[3,3,0,0,
{\\"a\\":[[1,2]]}],[4,3,0,-1
],[6,3,3,4]]"`;
exports[`dom minify = true 1`] = `"[[0,[\\"VIEW\\",\\"id\\",\\"view\\",\\"hidden\\",true]],[3,3,0,0,
-1,{\\"a\\":[[1,2]]}
],[6,3,3,4]]"`;
exports[`dom minify = true 2`] = `"[[0,[\\"VIEW\\",\\"id\\",\\"view\\",\\"hidden\\",true]],[\\"create\\",3,\\"VIEW\\",0,
{\\"a\\":{\\"id\\":\\"view\\"}}],[\\"insert\\",3,0,-1
],[\\"setAttr\\",3,\\"hidden\\",true]]"`;
exports[`dom minify = true 2`] = `"[[0,[\\"VIEW\\",\\"id\\",\\"view\\",\\"hidden\\",true]],[\\"create\\",3,\\"VIEW\\",0,
-1,{\\"a\\":{\\"id\\":\\"view\\"}}
],[\\"setAttr\\",3,\\"hidden\\",true]]"`;
exports[`dom minify = true 3`] = `"[[0,[\\"hidden\\"]],[7,3,0]]"`;
...
...
@@ -16,9 +16,9 @@ exports[`dom minify = true 7`] = `"[[0,[]],[5,3]]"`;
exports[`dom minify = true 8`] = `"[[0,[]],[\\"remove\\",3]]"`;
exports[`dom minify = true 9`] = `"[[0,[\\"#text\\",\\"hello\\"]],[3,4,0,0,
{\\"t\\":1}],[4,4,0,-1
]]"`;
exports[`dom minify = true 9`] = `"[[0,[\\"#text\\",\\"hello\\"]],[3,4,0,0,
-1,{\\"t\\":1}
]]"`;
exports[`dom minify = true 10`] = `"[[0,[\\"#text\\",\\"hello\\"]],[\\"create\\",4,\\"#text\\",0,
{\\"t\\":\\"hello\\"}],[\\"insert\\",4,0,-1
]]"`;
exports[`dom minify = true 10`] = `"[[0,[\\"#text\\",\\"hello\\"]],[\\"create\\",4,\\"#text\\",0,
-1,{\\"t\\":\\"hello\\"}
]]"`;
exports[`dom minify = true 11`] = `"[[0,[\\"onClick\\"]],[8,4,0,0]]"`;
...
...
packages/uni-app-plus/__tests__/service/dom/dom.spec.ts
浏览文件 @
5ec7a426
import
{
ACTION_TYPE_ADD_EVENT
,
ACTION_TYPE_CREATE
,
ACTION_TYPE_INSERT
,
ACTION_TYPE_REMOVE
,
ACTION_TYPE_REMOVE_ATTRIBUTE
,
ACTION_TYPE_REMOVE_EVENT
,
ACTION_TYPE_SET_ATTRIBUTE
,
ACTION_TYPE_SET_TEXT
,
CreateAction
,
InsertAction
,
SetAttributeAction
,
UniEventListener
,
EventModifierFlags
,
...
...
@@ -57,14 +55,15 @@ describe('dom', () => {
expect
(
createElementAction
[
1
]).
toBe
(
1
)
expect
(
createElementAction
[
2
]).
toBe
(
'
VIEW
'
)
expect
(
createElementAction
[
3
]).
toBe
(
0
)
expect
((
createElementAction
[
4
]
!
.
a
as
any
).
id
).
toBe
(
'
view
'
)
const
addElementAction
=
updateActions
[
1
]
as
InsertAction
expect
(
addElementAction
[
0
]).
toBe
(
ACTION_TYPE_INSERT
)
expect
(
addElementAction
[
1
]).
toBe
(
1
)
// nodeId
expect
(
addElementAction
[
2
]).
toBe
(
0
)
// parentNodeId
expect
(
addElementAction
[
3
]).
toBe
(
-
1
)
// index
const
setAttributeAction
=
updateActions
[
2
]
as
SetAttributeAction
expect
(
createElementAction
[
4
]).
toBe
(
-
1
)
expect
((
createElementAction
[
5
]
!
.
a
as
any
).
id
).
toBe
(
'
view
'
)
// const addElementAction = updateActions[1] as InsertAction
// expect(addElementAction[0]).toBe(ACTION_TYPE_INSERT)
// expect(addElementAction[1]).toBe(1) // nodeId
// expect(addElementAction[2]).toBe(0) // parentNodeId
// expect(addElementAction[3]).toBe(-1) // index
const
setAttributeAction
=
updateActions
[
1
]
as
SetAttributeAction
expect
(
setAttributeAction
[
0
]).
toBe
(
ACTION_TYPE_SET_ATTRIBUTE
)
expect
(
setAttributeAction
[
1
]).
toBe
(
1
)
expect
(
setAttributeAction
[
2
]).
toBe
(
'
hidden
'
)
...
...
@@ -100,12 +99,13 @@ describe('dom', () => {
const
textNode
=
createTextNode
(
'
hello
'
,
{
pageNode
:
root
})
root
.
appendChild
(
textNode
)
const
{
updateActions
:
[
,
addTextNodeAction
],
updateActions
:
[
addTextNodeAction
],
}
=
root
expect
(
addTextNodeAction
[
0
]).
toBe
(
ACTION_TYPE_
INSERT
)
expect
(
addTextNodeAction
[
0
]).
toBe
(
ACTION_TYPE_
CREATE
)
expect
(
addTextNodeAction
[
1
]).
toBe
(
2
)
expect
(
addTextNodeAction
[
2
]).
toBe
(
0
)
expect
(
addTextNodeAction
[
3
]).
toBe
(
-
1
)
expect
(
addTextNodeAction
[
2
]).
toBe
(
'
#text
'
)
expect
(
addTextNodeAction
[
3
]).
toBe
(
0
)
expect
(
addTextNodeAction
[
4
]).
toBe
(
-
1
)
root
.
updateActions
.
length
=
0
const
clickFn
=
()
=>
{}
...
...
packages/uni-app-plus/dist/tools.umd.js
浏览文件 @
5ec7a426
...
...
@@ -95,12 +95,13 @@
}
return
nodeJson
;
}
function
decodeCreateAction
([,
nodeId
,
nodeName
,
parentNodeId
,
nodeJson
],
getDict
)
{
function
decodeCreateAction
([,
nodeId
,
nodeName
,
parentNodeId
,
refNodeId
,
nodeJson
],
getDict
)
{
return
[
'
create
'
,
nodeId
,
getDict
(
nodeName
),
parentNodeId
,
refNodeId
,
decodeNodeJson
(
getDict
,
nodeJson
),
];
}
...
...
packages/uni-app-plus/dist/uni-app-service.es.js
浏览文件 @
5ec7a426
...
...
@@ -625,7 +625,7 @@ var serviceContext = (function (vue) {
}
return req;
}),
},
callback, page.$page.id
);
},
page.$page.id, callback
);
}
function formatLog(module, ...args) {
...
...
@@ -1802,10 +1802,10 @@ var serviceContext = (function (vue) {
function publishViewMethodName() {
return getCurrentPageId() + '.' + INVOKE_VIEW_API;
}
const invokeViewMethod = (name, args,
callback, pageId
) => {
const invokeViewMethod = (name, args,
pageId, callback
) => {
const { subscribe, publishHandler } = UniServiceJSBridge;
const id = invokeViewMethodId++;
subscribe(INVOKE_VIEW_API + '.' + id, callback, true);
callback &&
subscribe(INVOKE_VIEW_API + '.' + id, callback, true);
publishHandler(publishViewMethodName(), { id, name, args }, pageId);
};
const invokeViewMethodKeepAlive = (name, args, callback, pageId) => {
...
...
@@ -2427,20 +2427,16 @@ var serviceContext = (function (vue) {
//#endregion
//#region UniServiceJSBridge
const canvasEventCallbacks = createCallbacks('canvasEvent');
const onCanvasMethodCallback = /*#__PURE__*/ once(() => {
UniServiceJSBridge.subscribe('onCanvasMethodCallback', ({ callbackId, data }) => {
function operateCanvas(canvasId, pageId, type, data) {
UniServiceJSBridge.invokeViewMethod(`canvas.${canvasId}`, {
type,
data,
}, pageId, ({ callbackId, data }) => {
const callback = canvasEventCallbacks.pop(callbackId);
if (callback) {
callback(data);
}
});
});
function operateCanvas(canvasId, pageId, type, data) {
UniServiceJSBridge.publishHandler('canvas.' + canvasId, {
canvasId,
type,
data,
}, pageId);
}
//#endregion
//#region methods
...
...
@@ -3271,7 +3267,7 @@ var serviceContext = (function (vue) {
}
}, CreateCanvasContextProtocol);
const canvasGetImageData = defineAsyncApi(API_CANVAS_GET_IMAGE_DATA, ({ canvasId, x, y, width, height }, { resolve, reject }) => {
onCanvasMethodCallback();
// onCanvasMethodCallback()
const pageId = getPageIdByVm(getCurrentPageVm());
if (!pageId) {
reject();
...
...
@@ -3301,7 +3297,7 @@ var serviceContext = (function (vue) {
});
}, CanvasGetImageDataProtocol, CanvasGetImageDataOptions);
const canvasPutImageData = defineAsyncApi(API_CANVAS_PUT_IMAGE_DATA, ({ canvasId, data, x, y, width, height }, { resolve, reject }) => {
onCanvasMethodCallback();
// onCanvasMethodCallback()
var pageId = getPageIdByVm(getCurrentPageVm());
if (!pageId) {
reject();
...
...
@@ -3335,7 +3331,7 @@ var serviceContext = (function (vue) {
operate();
}, CanvasPutImageDataProtocol, CanvasPutImageDataOptions);
const canvasToTempFilePath = defineAsyncApi(API_CANVAS_TO_TEMP_FILE_PATH, ({ x = 0, y = 0, width, height, destWidth, destHeight, canvasId, fileType, quality, }, { resolve, reject }) => {
onCanvasMethodCallback();
// onCanvasMethodCallback()
var pageId = getPageIdByVm(getCurrentPageVm());
if (!pageId) {
reject();
...
...
@@ -3501,12 +3497,12 @@ var serviceContext = (function (vue) {
UniServiceJSBridge.invokeViewMethod(`editor.${componentId}`, {
type,
data,
}, ({ callbackId, data }) => {
},
pageId,
({ callbackId, data }) => {
if (needCallOptions) {
callOptions(optionsCache[callbackId], data);
delete optionsCache[callbackId];
}
}
, pageId
);
});
}
class EditorContext {
id;
...
...
@@ -3853,7 +3849,7 @@ var serviceContext = (function (vue) {
const API_GET_SELECTED_TEXT_RANGE = 'getSelectedTextRange';
const getSelectedTextRange = defineAsyncApi(API_GET_SELECTED_TEXT_RANGE, (_, { resolve, reject }) => {
UniServiceJSBridge.invokeViewMethod('getSelectedTextRange', {}, (res) => {
UniServiceJSBridge.invokeViewMethod('getSelectedTextRange', {},
getCurrentPageId(),
(res) => {
if (typeof res.end === 'undefined' &&
typeof res.start === 'undefined') {
reject('no focused');
...
...
@@ -3861,7 +3857,7 @@ var serviceContext = (function (vue) {
else {
resolve(res);
}
}
, getCurrentPageId()
);
});
});
const API_GET_BACKGROUND_AUDIO_MANAGER = 'getBackgroundAudioManager';
...
...
@@ -10046,8 +10042,9 @@ var serviceContext = (function (vue) {
const createAction = this._createActionMap.get(action[1]);
if (createAction) {
createAction[3] = action[2]; // parentNodeId
createAction[4] = action[3]; // anchorId
if (extras) {
createAction[
4
] = extras;
createAction[
5
] = extras;
}
}
else {
...
...
@@ -10057,7 +10054,10 @@ var serviceContext = (function (vue) {
}
break;
}
this.updateActions.push(action);
// insert 被合并进 create
if (action[0] !== ACTION_TYPE_INSERT) {
this.updateActions.push(action);
}
vue.queuePostFlushCb(this._update);
}
restore() {
...
...
@@ -10115,7 +10115,13 @@ var serviceContext = (function (vue) {
return null;
}
function pushCreateAction(pageNode, nodeId, nodeName) {
pageNode.push([ACTION_TYPE_CREATE, nodeId, pageNode.addDict(nodeName), -1]);
pageNode.push([
ACTION_TYPE_CREATE,
nodeId,
pageNode.addDict(nodeName),
-1,
-1,
]);
}
function pushInsertAction(pageNode, newChild, parentNodeId, refChildId) {
const nodeJson = newChild.toJSON({
...
...
packages/uni-app-plus/dist/uni-app-view.umd.js
浏览文件 @
5ec7a426
此差异已折叠。
点击以展开。
packages/uni-app-plus/src/service/framework/dom/Page.ts
浏览文件 @
5ec7a426
...
...
@@ -175,8 +175,9 @@ export default class UniPageNode extends UniNode implements IUniPageNode {
const
createAction
=
this
.
_createActionMap
.
get
(
action
[
1
])
if
(
createAction
)
{
createAction
[
3
]
=
action
[
2
]
// parentNodeId
createAction
[
4
]
=
action
[
3
]
// anchorId
if
(
extras
)
{
createAction
[
4
]
=
extras
as
UniNodeJSON
createAction
[
5
]
=
extras
as
UniNodeJSON
}
}
else
{
if
(
__DEV__
)
{
...
...
@@ -185,7 +186,10 @@ export default class UniPageNode extends UniNode implements IUniPageNode {
}
break
}
this
.
updateActions
.
push
(
action
)
// insert 被合并进 create
if
(
action
[
0
]
!==
ACTION_TYPE_INSERT
)
{
this
.
updateActions
.
push
(
action
)
}
queuePostFlushCb
(
this
.
_update
)
}
restore
()
{
...
...
@@ -255,7 +259,13 @@ function pushCreateAction(
nodeId
:
number
,
nodeName
:
string
|
number
)
{
pageNode
.
push
([
ACTION_TYPE_CREATE
,
nodeId
,
pageNode
.
addDict
(
nodeName
),
-
1
])
pageNode
.
push
([
ACTION_TYPE_CREATE
,
nodeId
,
pageNode
.
addDict
(
nodeName
),
-
1
,
-
1
,
])
}
function
pushInsertAction
(
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniAd.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniAd extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-ad
'
,
Ad
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-ad
'
,
Ad
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniAudio.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniAudio extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-audio
'
,
Audio
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-audio
'
,
Audio
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniButton.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniButton extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-button
'
,
Button
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-button
'
,
Button
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniCamera.ts
浏览文件 @
5ec7a426
import
{
UniTodoNode
}
from
'
../elements/UniTodoNode
'
export
class
UniCamera
extends
UniTodoNode
{
constructor
(
id
:
number
,
parentNodeId
:
number
)
{
super
(
id
,
'
uni-camera
'
,
parentNodeId
)
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
)
{
super
(
id
,
'
uni-camera
'
,
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniCanvas.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,17 @@ export class UniCanvas extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-canvas
'
,
Canvas
,
parentNodeId
,
nodeJson
,
'
canvas > div
'
)
super
(
id
,
'
uni-canvas
'
,
Canvas
,
parentNodeId
,
refNodeId
,
nodeJson
,
'
canvas > div
'
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniCheckbox.ts
浏览文件 @
5ec7a426
...
...
@@ -7,6 +7,7 @@ export class UniCheckbox extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
...
...
@@ -14,6 +15,7 @@ export class UniCheckbox extends UniComponent {
'
uni-checkbox
'
,
Checkbox
,
parentNodeId
,
refNodeId
,
nodeJson
,
'
.uni-checkbox-wrapper
'
)
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniCheckboxGroup.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,16 @@ export class UniCheckboxGroup extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-checkbox-group
'
,
CheckboxGroup
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-checkbox-group
'
,
CheckboxGroup
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniComponent.ts
浏览文件 @
5ec7a426
import
{
hasOwn
}
from
'
@vue/shared
'
import
{
Component
,
ComponentInternalInstance
,
createApp
,
reactive
}
from
'
vue
'
import
{
App
,
Component
,
ComponentInternalInstance
,
createApp
,
reactive
,
// @ts-expect-error
flushPostFlushCbs
,
}
from
'
vue
'
import
{
formatLog
,
parseEventName
,
UniNodeJSON
}
from
'
@dcloudio/uni-shared
'
import
{
UniNode
}
from
'
../elements/UniNode
'
import
{
createInvoker
}
from
'
../modules/events
'
import
{
createWrapper
,
UniCustomElement
}
from
'
.
'
import
{
$
}
from
'
../page
'
import
{
$
,
removeElement
}
from
'
../page
'
import
{
queuePostActionJob
}
from
'
../scheduler
'
export
class
UniComponent
extends
UniNode
{
declare
$
:
UniCustomElement
protected
$props
!
:
Record
<
string
,
any
>
$holder
?:
Element
$app
!
:
App
constructor
(
id
:
number
,
tag
:
string
,
component
:
Component
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
,
selector
?:
string
)
{
...
...
@@ -23,7 +34,8 @@ export class UniComponent extends UniNode {
;(
container
as
any
).
__vueParent
=
getVueParent
(
this
)
this
.
$props
=
reactive
({})
this
.
init
(
nodeJson
)
createApp
(
createWrapper
(
component
,
this
.
$props
)).
mount
(
container
)
this
.
$app
=
createApp
(
createWrapper
(
component
,
this
.
$props
))
this
.
$app
.
mount
(
container
)
this
.
$
=
container
.
firstElementChild
!
as
UniCustomElement
if
(
selector
)
{
this
.
$holder
=
this
.
$
.
querySelector
(
selector
)
!
...
...
@@ -36,6 +48,9 @@ export class UniComponent extends UniNode {
if
(
hasOwn
(
nodeJson
,
'
t
'
))
{
this
.
setText
(
nodeJson
.
t
||
''
)
}
this
.
insert
(
parentNodeId
,
refNodeId
)
// 延迟到insert之后,再flush,确保mounted等生命周期触发正常
flushPostFlushCbs
()
}
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
const
{
a
,
e
}
=
nodeJson
...
...
@@ -70,6 +85,12 @@ export class UniComponent extends UniNode {
removeAttr
(
name
:
string
)
{
this
.
$props
[
name
]
=
null
}
remove
()
{
this
.
isUnmounted
=
true
this
.
$app
.
unmount
()
removeElement
(
this
.
id
)
}
appendChild
(
node
:
Element
)
{
return
(
this
.
$holder
||
this
.
$
).
appendChild
(
node
)
}
...
...
@@ -79,33 +100,40 @@ export class UniComponent extends UniNode {
}
export
class
UniContainerComponent
extends
UniComponent
{
private
_rebuild
!
:
Function
constructor
(
id
:
number
,
tag
:
string
,
component
:
Component
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
,
selector
?:
string
)
{
super
(
id
,
tag
,
component
,
parentNodeId
,
nodeJson
,
selector
)
this
.
initObserver
(
)
super
(
id
,
tag
,
component
,
parentNodeId
,
refNodeId
,
nodeJson
,
selector
)
this
.
_rebuild
=
this
.
rebuild
.
bind
(
this
)
}
initObserver
()
{
const
elem
=
this
.
$holder
||
this
.
$
const
observer
=
new
MutationObserver
((
mutations
)
=>
{
if
(
__DEV__
)
{
console
.
log
(
formatLog
(
'
Observer
'
,
mutations
))
}
// TODO 刷新容器组件状态
const
vm
=
this
.
$
.
__vueParentComponent
if
((
vm
as
any
).
rebuild
)
{
;(
vm
as
any
).
rebuild
()
}
})
observer
.
observe
(
elem
,
{
childList
:
true
,
subtree
:
true
,
})
setText
(
text
:
string
)
{
queuePostActionJob
(
this
.
_rebuild
)
return
super
.
setText
(
text
)
}
appendChild
(
node
:
Element
)
{
queuePostActionJob
(
this
.
_rebuild
)
return
super
.
appendChild
(
node
)
}
insertBefore
(
newChild
:
Node
,
refChild
:
Node
)
{
queuePostActionJob
(
this
.
_rebuild
)
return
super
.
insertBefore
(
newChild
,
refChild
)
}
rebuild
()
{
// 刷新容器组件状态
if
(
__DEV__
)
{
console
.
log
(
formatLog
(
'
rebuild
'
,
this
.
id
,
this
.
tag
))
}
const
vm
=
this
.
$
.
__vueParentComponent
if
((
vm
as
any
).
rebuild
)
{
;(
vm
as
any
).
rebuild
()
}
}
}
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniCoverImage.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniCoverImage extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-cover-image
'
,
CoverImage
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-cover-image
'
,
CoverImage
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniCoverView.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniCoverView extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-cover-view
'
,
CoverView
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-cover-view
'
,
CoverView
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniEditor.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniEditor extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-editor
'
,
Editor
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-editor
'
,
Editor
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniForm.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniForm extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-form
'
,
Form
,
parentNodeId
,
nodeJson
,
'
span
'
)
super
(
id
,
'
uni-form
'
,
Form
,
parentNodeId
,
refNodeId
,
nodeJson
,
'
span
'
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniFunctionalPageNavigator.ts
浏览文件 @
5ec7a426
import
{
UniTodoNode
}
from
'
../elements/UniTodoNode
'
export
class
UniFunctionalPageNavigator
extends
UniTodoNode
{
constructor
(
id
:
number
,
parentNodeId
:
number
)
{
super
(
id
,
'
uni-functional-page-navigator
'
,
parentNodeId
)
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
)
{
super
(
id
,
'
uni-functional-page-navigator
'
,
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniIcon.ts
浏览文件 @
5ec7a426
...
...
@@ -8,8 +8,9 @@ export class UniIcon extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-icon
'
,
Icon
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-icon
'
,
Icon
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniImage.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniImage extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-image
'
,
Image
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-image
'
,
Image
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniInput.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniInput extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-input
'
,
Input
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-input
'
,
Input
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniLabel.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniLabel extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-label
'
,
Label
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-label
'
,
Label
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniLivePlayer.ts
浏览文件 @
5ec7a426
import
{
UniTodoNode
}
from
'
../elements/UniTodoNode
'
export
class
UniLivePlayer
extends
UniTodoNode
{
constructor
(
id
:
number
,
parentNodeId
:
number
)
{
super
(
id
,
'
uni-live-player
'
,
parentNodeId
)
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
)
{
super
(
id
,
'
uni-live-player
'
,
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniLivePusher.ts
浏览文件 @
5ec7a426
import
{
UniTodoNode
}
from
'
../elements/UniTodoNode
'
export
class
UniLivePusher
extends
UniTodoNode
{
constructor
(
id
:
number
,
parentNodeId
:
number
)
{
super
(
id
,
'
uni-live-pusher
'
,
parentNodeId
)
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
)
{
super
(
id
,
'
uni-live-pusher
'
,
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniMap.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniMap extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-map
'
,
Map
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-map
'
,
Map
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniMovableArea.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,16 @@ export class UniMovableArea extends UniContainerComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-movable-area
'
,
MovableArea
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-movable-area
'
,
MovableArea
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniMovableView.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,16 @@ export class UniMovableView extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-movable-view
'
,
MovableView
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-movable-view
'
,
MovableView
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniNavigator.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniNavigator extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-navigator
'
,
Navigator
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-navigator
'
,
Navigator
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniOfficialAccount.ts
浏览文件 @
5ec7a426
import
{
UniTodoNode
}
from
'
../elements/UniTodoNode
'
export
class
UniOfficialAccount
extends
UniTodoNode
{
constructor
(
id
:
number
,
parentNodeId
:
number
)
{
super
(
id
,
'
uni-official-account
'
,
parentNodeId
)
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
)
{
super
(
id
,
'
uni-official-account
'
,
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniOpenData.ts
浏览文件 @
5ec7a426
import
{
UniTodoNode
}
from
'
../elements/UniTodoNode
'
export
class
UniOpenData
extends
UniTodoNode
{
constructor
(
id
:
number
,
parentNodeId
:
number
)
{
super
(
id
,
'
uni-open-data
'
,
parentNodeId
)
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
)
{
super
(
id
,
'
uni-open-data
'
,
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniPicker.ts
浏览文件 @
5ec7a426
...
...
@@ -6,8 +6,9 @@ export class UniPicker extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-picker
'
,
Picker
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-picker
'
,
Picker
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniPickerView.ts
浏览文件 @
5ec7a426
...
...
@@ -7,6 +7,7 @@ export class UniPickerView extends UniContainerComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
...
...
@@ -14,6 +15,7 @@ export class UniPickerView extends UniContainerComponent {
'
uni-picker-view
'
,
PickerView
,
parentNodeId
,
refNodeId
,
nodeJson
,
'
.uni-picker-view-wrapper
'
)
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniPickerViewColumn.ts
浏览文件 @
5ec7a426
...
...
@@ -7,6 +7,7 @@ export class UniPickerViewColumn extends UniContainerComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
...
...
@@ -14,6 +15,7 @@ export class UniPickerViewColumn extends UniContainerComponent {
'
uni-picker-view-column
'
,
PickerViewColumn
,
parentNodeId
,
refNodeId
,
nodeJson
,
'
.uni-picker-view-content
'
)
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniProgress.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniProgress extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-progress
'
,
Progress
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-progress
'
,
Progress
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniRadio.ts
浏览文件 @
5ec7a426
...
...
@@ -7,9 +7,18 @@ export class UniRadio extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-radio
'
,
Radio
,
parentNodeId
,
nodeJson
,
'
.uni-radio-wrapper
'
)
super
(
id
,
'
uni-radio
'
,
Radio
,
parentNodeId
,
refNodeId
,
nodeJson
,
'
.uni-radio-wrapper
'
)
}
setText
(
text
:
string
)
{
setHolderText
(
this
.
$holder
!
,
'
uni-radio-input
'
,
text
)
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniRadioGroup.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniRadioGroup extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-radio-group
'
,
RadioGroup
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-radio-group
'
,
RadioGroup
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniRichText.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniRichText extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-rich-text
'
,
RichText
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-rich-text
'
,
RichText
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniScrollView.ts
浏览文件 @
5ec7a426
...
...
@@ -7,6 +7,7 @@ export class UniScrollView extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
...
...
@@ -14,6 +15,7 @@ export class UniScrollView extends UniComponent {
'
uni-scroll-view
'
,
ScrollView
,
parentNodeId
,
refNodeId
,
nodeJson
,
'
.uni-scroll-view-content
'
)
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniSlider.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniSlider extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-slider
'
,
Slider
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-slider
'
,
Slider
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniSwiper.ts
浏览文件 @
5ec7a426
...
...
@@ -7,6 +7,7 @@ export class UniSwiper extends UniContainerComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
...
...
@@ -14,6 +15,7 @@ export class UniSwiper extends UniContainerComponent {
'
uni-swiper
'
,
Swiper
,
parentNodeId
,
refNodeId
,
nodeJson
,
'
.uni-swiper-slide-frame
'
)
...
...
packages/uni-app-plus/src/view/framework/dom/components/UniSwiperItem.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniSwiperItem extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-swiper-item
'
,
SwiperItem
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-swiper-item
'
,
SwiperItem
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniSwitch.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniSwitch extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-switch
'
,
Switch
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-switch
'
,
Switch
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniTextarea.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniTextarea extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-textarea
'
,
Textarea
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-textarea
'
,
Textarea
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniVideo.ts
浏览文件 @
5ec7a426
...
...
@@ -8,8 +8,9 @@ export class UniVideo extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-video
'
,
Video
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-video
'
,
Video
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/components/UniWebView.ts
浏览文件 @
5ec7a426
...
...
@@ -7,8 +7,9 @@ export class UniWebView extends UniComponent {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
uni-web-view
'
,
WebView
,
parentNodeId
,
nodeJson
)
super
(
id
,
'
uni-web-view
'
,
WebView
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/decodeActions.ts
浏览文件 @
5ec7a426
...
...
@@ -131,7 +131,7 @@ export function decodeNodeJson(
}
function
decodeCreateAction
(
[,
nodeId
,
nodeName
,
parentNodeId
,
nodeJson
]:
CreateAction
,
[,
nodeId
,
nodeName
,
parentNodeId
,
refNodeId
,
nodeJson
]:
CreateAction
,
getDict
:
GetDict
)
{
return
[
...
...
@@ -139,6 +139,7 @@ function decodeCreateAction(
nodeId
,
getDict
(
nodeName
as
number
),
parentNodeId
,
refNodeId
,
decodeNodeJson
(
getDict
,
nodeJson
as
UniNodeJSONMinify
),
]
}
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniComment.ts
浏览文件 @
5ec7a426
import
{
UniNode
}
from
'
./UniNode
'
export
class
UniComment
extends
UniNode
{
constructor
(
id
:
number
,
parentNodeId
:
number
)
{
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
)
{
super
(
id
,
'
#comment
'
,
parentNodeId
,
document
.
createComment
(
''
))
this
.
insert
(
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/elements/UniElement.ts
浏览文件 @
5ec7a426
...
...
@@ -17,6 +17,7 @@ export class UniElement<T extends object> extends UniNode {
id
:
number
,
element
:
Element
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
,
propNames
:
string
[]
=
[]
)
{
...
...
@@ -26,6 +27,7 @@ export class UniElement<T extends object> extends UniNode {
this
.
$propNames
=
propNames
this
.
_update
=
this
.
update
.
bind
(
this
)
this
.
init
(
nodeJson
)
this
.
insert
(
parentNodeId
,
refNodeId
)
}
init
(
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
if
(
hasOwn
(
nodeJson
,
'
a
'
))
{
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniHoverElement.ts
浏览文件 @
5ec7a426
...
...
@@ -19,10 +19,11 @@ export class UniHoverElement extends UniElement<HoverProps> {
id
:
number
,
element
:
Element
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
,
propNames
:
string
[]
=
[]
)
{
super
(
id
,
element
,
parentNodeId
,
nodeJson
,
[
super
(
id
,
element
,
parentNodeId
,
refNodeId
,
nodeJson
,
[
...
PROP_NAMES_HOVER
,
...
propNames
,
])
...
...
@@ -51,8 +52,8 @@ class Hover {
private
_hovering
:
boolean
=
false
private
_hoverTouch
:
boolean
=
false
private
_hoverStartTimer
:
number
=
0
private
_hoverStayTimer
:
number
=
0
private
_hoverStartTimer
?:
ReturnType
<
typeof
setTimeout
>
private
_hoverStayTimer
?:
ReturnType
<
typeof
setTimeout
>
private
__hoverTouchStart
!
:
(
evt
:
Event
)
=>
void
private
__hoverTouchEnd
!
:
(
evt
?:
Event
)
=>
void
...
...
@@ -143,7 +144,7 @@ class Hover {
}
_hoverReset
()
{
requestAnimationFrame
(()
=>
{
clearTimeout
(
this
.
_hoverStayTimer
)
clearTimeout
(
this
.
_hoverStayTimer
!
)
this
.
_hoverStayTimer
=
setTimeout
(()
=>
{
this
.
hovering
=
false
},
this
.
props
[
'
hover-stay-time
'
])
...
...
@@ -152,6 +153,6 @@ class Hover {
_hoverTouchCancel
()
{
this
.
_hoverTouch
=
false
this
.
hovering
=
false
clearTimeout
(
this
.
_hoverStartTimer
)
clearTimeout
(
this
.
_hoverStartTimer
!
)
}
}
packages/uni-app-plus/src/view/framework/dom/elements/UniNode.ts
浏览文件 @
5ec7a426
...
...
@@ -44,7 +44,7 @@ export class UniNode {
remove
()
{
const
{
$
}
=
this
$
.
parentNode
!
.
removeChild
(
$
)
this
.
isUnmounted
=
fals
e
this
.
isUnmounted
=
tru
e
removeElement
(
this
.
id
)
}
appendChild
(
node
:
Node
)
{
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniTextElement.ts
浏览文件 @
5ec7a426
import
'
@dcloudio/uni-components/style/text.css
'
import
{
DecodeOptions
,
parseText
}
from
'
@dcloudio/uni-components
'
import
{
UniElement
}
from
'
./UniElement
'
import
{
formatLog
,
UniNodeJSON
}
from
'
@dcloudio/uni-shared
'
import
{
UniNodeJSON
}
from
'
@dcloudio/uni-shared
'
interface
TextProps
{
space
:
DecodeOptions
[
'
space
'
]
...
...
@@ -16,12 +16,14 @@ export class UniTextElement extends UniElement<TextProps> {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
document
.
createElement
(
'
uni-text
'
),
parentNodeId
,
refNodeId
,
nodeJson
,
PROP_NAMES_HOVER
)
...
...
packages/uni-app-plus/src/view/framework/dom/elements/UniTextNode.ts
浏览文件 @
5ec7a426
...
...
@@ -5,9 +5,11 @@ export class UniTextNode extends UniNode {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
'
#text
'
,
parentNodeId
,
document
.
createTextNode
(
''
))
this
.
init
(
nodeJson
)
this
.
insert
(
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/elements/UniTodoNode.ts
浏览文件 @
5ec7a426
import
{
UniNode
}
from
'
../elements/UniNode
'
export
class
UniTodoNode
extends
UniNode
{
constructor
(
id
:
number
,
tag
:
string
,
parentNodeId
:
number
)
{
constructor
(
id
:
number
,
tag
:
string
,
parentNodeId
:
number
,
refNodeId
:
number
)
{
super
(
id
,
tag
,
parentNodeId
)
this
.
insert
(
parentNodeId
,
refNodeId
)
}
}
packages/uni-app-plus/src/view/framework/dom/elements/UniViewElement.ts
浏览文件 @
5ec7a426
...
...
@@ -5,8 +5,15 @@ export class UniViewElement extends UniHoverElement {
constructor
(
id
:
number
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
)
{
super
(
id
,
document
.
createElement
(
'
uni-view
'
),
parentNodeId
,
nodeJson
)
super
(
id
,
document
.
createElement
(
'
uni-view
'
),
parentNodeId
,
refNodeId
,
nodeJson
)
}
}
packages/uni-app-plus/src/view/framework/dom/index.ts
浏览文件 @
5ec7a426
...
...
@@ -3,7 +3,7 @@ import {
ACTION_TYPE_PAGE_CREATE
,
ACTION_TYPE_PAGE_CREATED
,
ACTION_TYPE_CREATE
,
ACTION_TYPE_INSERT
,
//
ACTION_TYPE_INSERT,
ACTION_TYPE_REMOVE
,
ACTION_TYPE_SET_ATTRIBUTE
,
ACTION_TYPE_REMOVE_ATTRIBUTE
,
...
...
@@ -34,10 +34,11 @@ export function onVdSync(actions: (PageAction | DictAction)[]) {
action
[
1
],
getDict
(
action
[
2
]
as
number
),
action
[
3
],
decodeNodeJson
(
getDict
,
action
[
4
]
as
UniNodeJSONMinify
)
action
[
4
],
decodeNodeJson
(
getDict
,
action
[
5
]
as
UniNodeJSONMinify
)
)
case
ACTION_TYPE_INSERT
:
return
$
(
action
[
1
]).
insert
(
action
[
2
],
action
[
3
])
//
case ACTION_TYPE_INSERT:
//
return $(action[1]).insert(action[2], action[3])
case
ACTION_TYPE_REMOVE
:
return
$
(
action
[
1
]).
remove
()
case
ACTION_TYPE_SET_ATTRIBUTE
:
...
...
packages/uni-app-plus/src/view/framework/dom/page.ts
浏览文件 @
5ec7a426
...
...
@@ -33,6 +33,7 @@ export function createElement(
id
:
number
,
tag
:
string
,
parentNodeId
:
number
,
refNodeId
:
number
,
nodeJson
:
Partial
<
UniNodeJSON
>
=
{}
)
{
let
element
:
UniNode
...
...
@@ -47,12 +48,13 @@ export function createElement(
}
else
{
const
Component
=
BuiltInComponents
[
tag
as
keyof
typeof
BuiltInComponents
]
if
(
Component
)
{
element
=
new
Component
(
id
,
parentNodeId
,
nodeJson
)
element
=
new
Component
(
id
,
parentNodeId
,
refNodeId
,
nodeJson
)
}
else
{
element
=
new
UniElement
(
id
,
document
.
createElement
(
tag
),
parentNodeId
,
refNodeId
,
nodeJson
)
}
...
...
@@ -118,7 +120,7 @@ function initSystemInfo(
}
function
initPageElement
()
{
createElement
(
0
,
'
div
'
,
-
1
).
$
=
document
.
getElementById
(
'
app
'
)
!
createElement
(
0
,
'
div
'
,
-
1
,
-
1
).
$
=
document
.
getElementById
(
'
app
'
)
!
}
function
initPageCss
(
route
:
string
)
{
...
...
packages/uni-app-vue/dist/view.runtime.esm.js
浏览文件 @
5ec7a426
...
...
@@ -6701,10 +6701,10 @@ function baseCreateRenderer(options, createHydrationFns) {
}
}
else
{
// fixed by xxxxxx 补充父组件
patch
(
container
.
_vnode
||
null
,
vnode
,
container
,
null
,
container
.
__vueParent
||
null
,
null
,
isSVG
);
patch
(
container
.
_vnode
||
null
,
vnode
,
container
,
null
,
null
,
null
,
isSVG
);
}
flushPostFlushCbs
();
// fixed by xxxxxx 调整到UniComponent里边触发flushPostFlushCbs
// flushPostFlushCbs()
container
.
_vnode
=
vnode
;
};
const
internals
=
{
...
...
@@ -10084,4 +10084,4 @@ function normalizeContainer(container) {
return
container
;
}
export
{
BaseTransition
,
Comment$1
as
Comment
,
Fragment
,
KeepAlive
,
Static
,
Suspense
,
Teleport
,
Text
,
Transition
,
TransitionGroup
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
camelize
,
capitalize
,
cloneVNode
,
compatUtils
,
computed$1
as
computed
,
createApp
,
createBlock
,
createCommentVNode
,
createHydrationRenderer
,
createRenderer
,
createSSRApp
,
createSlots
,
createStaticVNode
,
createTextVNode
,
createVNode
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmit
,
defineEmits
,
defineExpose
,
defineProps
,
devtools
,
getCurrentInstance
,
getTransitionRawChildren
,
h
,
handleError
,
hydrate
,
initCustomFormatter
,
inject
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
isRuntimeOnly
,
isVNode
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
openBlock
,
popScopeId
,
provide
,
proxyRefs
,
pushScopeId
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
registerRuntimeCompiler
,
render
,
renderList
,
renderSlot
,
resolveComponent
,
resolveDirective
,
resolveDynamicComponent
,
resolveFilter
,
resolveTransitionHooks
,
setBlockTracking
,
setDevtoolsHook
,
setTransitionHooks
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
ssrContextKey
,
ssrUtils
,
toDisplayString
,
toHandlerKey
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
transformVNodeArgs
,
triggerRef
,
unref
,
useAttrs
,
useContext
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
useTransitionState
,
vModelCheckbox
,
vModelDynamic
,
vModelRadio
,
vModelSelect
,
vModelText
,
vShow
,
version
,
warn
,
watch
,
watchEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withKeys
,
withModifiers
,
withScopeId
};
export
{
BaseTransition
,
Comment$1
as
Comment
,
Fragment
,
KeepAlive
,
Static
,
Suspense
,
Teleport
,
Text
,
Transition
,
TransitionGroup
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
camelize
,
capitalize
,
cloneVNode
,
compatUtils
,
computed$1
as
computed
,
createApp
,
createBlock
,
createCommentVNode
,
createHydrationRenderer
,
createRenderer
,
createSSRApp
,
createSlots
,
createStaticVNode
,
createTextVNode
,
createVNode
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmit
,
defineEmits
,
defineExpose
,
defineProps
,
devtools
,
flushPostFlushCbs
,
getCurrentInstance
,
getTransitionRawChildren
,
h
,
handleError
,
hydrate
,
initCustomFormatter
,
inject
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
isRuntimeOnly
,
isVNode
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
openBlock
,
popScopeId
,
provide
,
proxyRefs
,
pushScopeId
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
registerRuntimeCompiler
,
render
,
renderList
,
renderSlot
,
resolveComponent
,
resolveDirective
,
resolveDynamicComponent
,
resolveFilter
,
resolveTransitionHooks
,
setBlockTracking
,
setDevtoolsHook
,
setTransitionHooks
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
ssrContextKey
,
ssrUtils
,
toDisplayString
,
toHandlerKey
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
transformVNodeArgs
,
triggerRef
,
unref
,
useAttrs
,
useContext
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
useTransitionState
,
vModelCheckbox
,
vModelDynamic
,
vModelRadio
,
vModelSelect
,
vModelText
,
vShow
,
version
,
warn
,
watch
,
watchEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withKeys
,
withModifiers
,
withScopeId
};
packages/uni-app-vue/lib/view.runtime.esm.js
浏览文件 @
5ec7a426
...
...
@@ -6719,10 +6719,10 @@ function baseCreateRenderer(options, createHydrationFns) {
}
}
else
{
// fixed by xxxxxx 补充父组件
patch
(
container
.
_vnode
||
null
,
vnode
,
container
,
null
,
container
.
__vueParent
||
null
,
null
,
isSVG
);
patch
(
container
.
_vnode
||
null
,
vnode
,
container
,
null
,
null
,
null
,
isSVG
);
}
flushPostFlushCbs
();
// fixed by xxxxxx 调整到UniComponent里边触发flushPostFlushCbs
// flushPostFlushCbs()
container
.
_vnode
=
vnode
;
};
const
internals
=
{
...
...
@@ -10102,4 +10102,4 @@ function normalizeContainer(container) {
return
container
;
}
export
{
BaseTransition
,
Comment$1
as
Comment
,
Fragment
,
KeepAlive
,
Static
,
Suspense
,
Teleport
,
Text
,
Transition
,
TransitionGroup
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
cloneVNode
,
compatUtils
,
computed$1
as
computed
,
createApp
,
createBlock
,
createCommentVNode
,
createHydrationRenderer
,
createRenderer
,
createSSRApp
,
createSlots
,
createStaticVNode
,
createTextVNode
,
createVNode
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmit
,
defineEmits
,
defineExpose
,
defineProps
,
devtools
,
getCurrentInstance
,
getTransitionRawChildren
,
h
,
handleError
,
hydrate
,
initCustomFormatter
,
inject
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
isRuntimeOnly
,
isVNode
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
openBlock
,
popScopeId
,
provide
,
proxyRefs
,
pushScopeId
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
registerRuntimeCompiler
,
render
,
renderList
,
renderSlot
,
resolveComponent
,
resolveDirective
,
resolveDynamicComponent
,
resolveFilter
,
resolveTransitionHooks
,
setBlockTracking
,
setDevtoolsHook
,
setTransitionHooks
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
ssrContextKey
,
ssrUtils
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
transformVNodeArgs
,
triggerRef
,
unref
,
useAttrs
,
useContext
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
useTransitionState
,
vModelCheckbox
,
vModelDynamic
,
vModelRadio
,
vModelSelect
,
vModelText
,
vShow
,
version
,
warn
,
watch
,
watchEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withKeys
,
withModifiers
,
withScopeId
};
export
{
BaseTransition
,
Comment$1
as
Comment
,
Fragment
,
KeepAlive
,
Static
,
Suspense
,
Teleport
,
Text
,
Transition
,
TransitionGroup
,
callWithAsyncErrorHandling
,
callWithErrorHandling
,
cloneVNode
,
compatUtils
,
computed$1
as
computed
,
createApp
,
createBlock
,
createCommentVNode
,
createHydrationRenderer
,
createRenderer
,
createSSRApp
,
createSlots
,
createStaticVNode
,
createTextVNode
,
createVNode
,
customRef
,
defineAsyncComponent
,
defineComponent
,
defineEmit
,
defineEmits
,
defineExpose
,
defineProps
,
devtools
,
flushPostFlushCbs
,
getCurrentInstance
,
getTransitionRawChildren
,
h
,
handleError
,
hydrate
,
initCustomFormatter
,
inject
,
isProxy
,
isReactive
,
isReadonly
,
isRef
,
isRuntimeOnly
,
isVNode
,
markRaw
,
mergeDefaults
,
mergeProps
,
nextTick
,
onActivated
,
onBeforeMount
,
onBeforeUnmount
,
onBeforeUpdate
,
onDeactivated
,
onErrorCaptured
,
onMounted
,
onRenderTracked
,
onRenderTriggered
,
onServerPrefetch
,
onUnmounted
,
onUpdated
,
openBlock
,
popScopeId
,
provide
,
proxyRefs
,
pushScopeId
,
queuePostFlushCb
,
reactive
,
readonly
,
ref
,
registerRuntimeCompiler
,
render
,
renderList
,
renderSlot
,
resolveComponent
,
resolveDirective
,
resolveDynamicComponent
,
resolveFilter
,
resolveTransitionHooks
,
setBlockTracking
,
setDevtoolsHook
,
setTransitionHooks
,
shallowReactive
,
shallowReadonly
,
shallowRef
,
ssrContextKey
,
ssrUtils
,
toHandlers
,
toRaw
,
toRef
,
toRefs
,
transformVNodeArgs
,
triggerRef
,
unref
,
useAttrs
,
useContext
,
useCssModule
,
useCssVars
,
useSSRContext
,
useSlots
,
useTransitionState
,
vModelCheckbox
,
vModelDynamic
,
vModelRadio
,
vModelSelect
,
vModelText
,
vShow
,
version
,
warn
,
watch
,
watchEffect
,
withAsyncContext
,
withCtx
,
withDefaults
,
withDirectives
,
withKeys
,
withModifiers
,
withScopeId
};
packages/uni-h5/dist/uni-h5.es.js
浏览文件 @
5ec7a426
...
...
@@ -788,7 +788,7 @@ var safeAreaInsets = {
onChange,
offChange
};
var
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out = safeAreaInsets;
var out = safeAreaInsets;
const onEventPrevent = /* @__PURE__ */ withModifiers(() => {
}, ["prevent"]);
const onEventStop = /* @__PURE__ */ withModifiers(() => {
...
...
@@ -800,10 +800,10 @@ function getWindowOffset() {
const left = parseInt(style.getPropertyValue("--window-left"));
const right = parseInt(style.getPropertyValue("--window-right"));
return {
top: top ? top +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top : 0,
bottom: bottom ? bottom +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.bottom : 0,
left: left ? left +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.left : 0,
right: right ? right +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.right : 0
top: top ? top + out.top : 0,
bottom: bottom ? bottom + out.bottom : 0,
left: left ? left + out.left : 0,
right: right ? right + out.right : 0
};
}
function updateCssVar(cssVars) {
...
...
@@ -13227,7 +13227,7 @@ function normalizePageMeta(pageMeta) {
}, pageMeta.pullToRefresh));
const { type, style } = navigationBar;
if (style !== "custom" && type !== "transparent") {
pullToRefresh.offset += NAVBAR_HEIGHT +
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top;
pullToRefresh.offset += NAVBAR_HEIGHT + out.top;
}
pageMeta.pullToRefresh = pullToRefresh;
}
...
...
@@ -15413,7 +15413,7 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const windowWidth = getWindowWidth(screenWidth);
let windowHeight = window.innerHeight;
const language = navigator.language;
const statusBarHeight =
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top;
const statusBarHeight = out.top;
let osname;
let osversion;
let model;
...
...
@@ -15526,12 +15526,12 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
const system = `${osname} ${osversion}`;
const platform = osname.toLocaleLowerCase();
const safeArea = {
left:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.left,
right: windowWidth -
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.right,
top:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top,
bottom: windowHeight -
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.bottom,
width: windowWidth -
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.left - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.right,
height: windowHeight -
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_out.top - D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.bottom
left: out.left,
right: windowWidth - out.right,
top: out.top,
bottom: windowHeight - out.bottom,
width: windowWidth -
out.left -
out.right,
height: windowHeight -
out.top -
out.bottom
};
const { top: windowTop, bottom: windowBottom } = getWindowOffset();
windowHeight -= windowTop;
...
...
@@ -15551,10 +15551,10 @@ const getSystemInfoSync = /* @__PURE__ */ defineSyncApi("getSystemInfoSync", ()
model,
safeArea,
safeAreaInsets: {
top:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.top,
right:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.right,
bottom:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.bottom,
left:
D__DCloud_local_git_uniAppNext_node_modules_safeAreaInsets_
out.left
top: out.top,
right: out.right,
bottom: out.bottom,
left: out.left
}
};
});
...
...
packages/uni-shared/dist/uni-shared.d.ts
浏览文件 @
5ec7a426
...
...
@@ -65,6 +65,7 @@ export declare const COMPONENT_SELECTOR_PREFIX = "uni-";
* nodeId
* tag
* parentNodeId
* refNodeId
* nodeJson
*/
export
declare
type
CreateAction
=
[
...
...
@@ -72,6 +73,7 @@ typeof ACTION_TYPE_CREATE,
number
,
string
|
number
,
number
,
number
,
Partial
<
UniNodeJSON
|
UniNodeJSONMinify
>
?
];
...
...
packages/uni-shared/src/vdom/Action.ts
浏览文件 @
5ec7a426
...
...
@@ -39,6 +39,7 @@ export type PageCreatedAction = [typeof ACTION_TYPE_PAGE_CREATED]
* nodeId
* tag
* parentNodeId
* refNodeId
* nodeJson
*/
export
type
CreateAction
=
[
...
...
@@ -46,6 +47,7 @@ export type CreateAction = [
number
,
string
|
number
,
number
,
number
,
Partial
<
UniNodeJSON
|
UniNodeJSONMinify
>
?
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录