Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
erosXXX
uni-app
提交
dcadcc5e
U
uni-app
项目概览
erosXXX
/
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,发现更多精彩内容 >>
提交
dcadcc5e
编写于
6月 03, 2020
作者:
fxy060608
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(wxs): $ownerInstance
上级
134a4638
变更
8
展开全部
隐藏空白更改
内联
并排
Showing
8 changed file
with
112 addition
and
68 deletion
+112
-68
packages/uni-app-plus/dist/index.v3.js
packages/uni-app-plus/dist/index.v3.js
+86
-54
packages/uni-app-plus/dist/view.umd.min.js
packages/uni-app-plus/dist/view.umd.min.js
+2
-2
packages/uni-h5/dist/index.umd.min.js
packages/uni-h5/dist/index.umd.min.js
+1
-1
packages/uni-h5/manifest.json
packages/uni-h5/manifest.json
+4
-0
src/core/view/plugins/index.js
src/core/view/plugins/index.js
+9
-4
src/platforms/app-plus/service/framework/plugins/data.js
src/platforms/app-plus/service/framework/plugins/data.js
+2
-2
src/platforms/app-plus/service/framework/plugins/vdom-sync.js
...platforms/app-plus/service/framework/plugins/vdom-sync.js
+4
-3
src/platforms/app-plus/view/framework/plugins/data.js
src/platforms/app-plus/view/framework/plugins/data.js
+4
-2
未找到文件。
packages/uni-app-plus/dist/index.v3.js
浏览文件 @
dcadcc5e
...
@@ -26,7 +26,8 @@ var serviceContext = (function () {
...
@@ -26,7 +26,8 @@ var serviceContext = (function () {
'
sendSocketMessage
'
,
'
sendSocketMessage
'
,
'
onSocketMessage
'
,
'
onSocketMessage
'
,
'
closeSocket
'
,
'
closeSocket
'
,
'
onSocketClose
'
'
onSocketClose
'
,
'
getUpdateManager
'
];
];
const
route
=
[
const
route
=
[
...
@@ -70,7 +71,7 @@ var serviceContext = (function () {
...
@@ -70,7 +71,7 @@ var serviceContext = (function () {
'
saveVideoToPhotosAlbum
'
,
'
saveVideoToPhotosAlbum
'
,
'
createVideoContext
'
,
'
createVideoContext
'
,
'
createCameraContext
'
,
'
createCameraContext
'
,
'
createLivePlayerContext
'
,
'
createLivePlayerContext
'
,
'
createLivePusherContext
'
'
createLivePusherContext
'
];
];
...
@@ -126,7 +127,7 @@ var serviceContext = (function () {
...
@@ -126,7 +127,7 @@ var serviceContext = (function () {
'
stopBeaconDiscovery
'
,
'
stopBeaconDiscovery
'
,
'
checkIsSupportSoterAuthentication
'
,
'
checkIsSupportSoterAuthentication
'
,
'
checkIsSoterEnrolledInDevice
'
,
'
checkIsSoterEnrolledInDevice
'
,
'
startSoterAuthentication
'
,
'
startSoterAuthentication
'
,
'
onUIStyleChange
'
'
onUIStyleChange
'
];
];
...
@@ -165,7 +166,7 @@ var serviceContext = (function () {
...
@@ -165,7 +166,7 @@ var serviceContext = (function () {
'
startPullDownRefresh
'
,
'
startPullDownRefresh
'
,
'
stopPullDownRefresh
'
,
'
stopPullDownRefresh
'
,
'
createSelectorQuery
'
,
'
createSelectorQuery
'
,
'
createIntersectionObserver
'
,
'
createIntersectionObserver
'
,
'
getMenuButtonBoundingClientRect
'
'
getMenuButtonBoundingClientRect
'
];
];
...
@@ -212,14 +213,14 @@ var serviceContext = (function () {
...
@@ -212,14 +213,14 @@ var serviceContext = (function () {
'
upx2px
'
,
'
upx2px
'
,
'
restoreGlobal
'
,
'
restoreGlobal
'
,
'
getSubNVueById
'
,
'
getSubNVueById
'
,
'
getCurrentSubNVue
'
,
'
getCurrentSubNVue
'
,
'
setPageMeta
'
,
'
setPageMeta
'
,
'
onNativeEventReceive
'
,
'
onNativeEventReceive
'
,
'
sendNativeEvent
'
,
'
sendNativeEvent
'
,
'
preloadPage
'
'
preloadPage
'
];
];
const
ad
=
[
const
ad
=
[
'
createRewardedVideoAd
'
'
createRewardedVideoAd
'
];
];
...
@@ -236,7 +237,7 @@ var serviceContext = (function () {
...
@@ -236,7 +237,7 @@ var serviceContext = (function () {
...
event
,
...
event
,
...
file
,
...
file
,
...
canvas
,
...
canvas
,
...
third
,
...
third
,
...
ad
...
ad
];
];
...
@@ -1626,7 +1627,7 @@ var serviceContext = (function () {
...
@@ -1626,7 +1627,7 @@ var serviceContext = (function () {
getProvider
:
getProvider
getProvider
:
getProvider
});
});
function
encodeQueryString
(
url
)
{
function
encodeQueryString
(
url
)
{
if
(
typeof
url
!==
'
string
'
)
{
if
(
typeof
url
!==
'
string
'
)
{
return
url
return
url
}
}
...
@@ -1649,9 +1650,9 @@ var serviceContext = (function () {
...
@@ -1649,9 +1650,9 @@ var serviceContext = (function () {
query
.
split
(
'
&
'
).
forEach
(
param
=>
{
query
.
split
(
'
&
'
).
forEach
(
param
=>
{
const
parts
=
param
.
replace
(
/
\+
/g
,
'
'
).
split
(
'
=
'
);
const
parts
=
param
.
replace
(
/
\+
/g
,
'
'
).
split
(
'
=
'
);
const
key
=
parts
.
shift
();
const
key
=
parts
.
shift
();
const
val
=
parts
.
length
>
0
?
const
val
=
parts
.
length
>
0
parts
.
join
(
'
=
'
)
:
?
parts
.
join
(
'
=
'
)
''
;
:
''
;
params
.
push
(
key
+
'
=
'
+
encodeURIComponent
(
val
));
params
.
push
(
key
+
'
=
'
+
encodeURIComponent
(
val
));
});
});
...
@@ -1659,8 +1660,8 @@ var serviceContext = (function () {
...
@@ -1659,8 +1660,8 @@ var serviceContext = (function () {
return
params
.
length
?
url
+
'
?
'
+
params
.
join
(
'
&
'
)
:
url
return
params
.
length
?
url
+
'
?
'
+
params
.
join
(
'
&
'
)
:
url
}
}
function
createValidator
(
type
)
{
function
createValidator
(
type
)
{
return
function
validator
(
url
,
params
)
{
return
function
validator
(
url
,
params
)
{
// 格式化为绝对路径路由
// 格式化为绝对路径路由
url
=
getRealRoute
(
url
);
url
=
getRealRoute
(
url
);
...
@@ -1733,24 +1734,24 @@ var serviceContext = (function () {
...
@@ -1733,24 +1734,24 @@ var serviceContext = (function () {
let
navigatorLock
;
let
navigatorLock
;
function
createProtocol
(
type
,
extras
=
{})
{
function
createProtocol
(
type
,
extras
=
{})
{
return
Object
.
assign
({
return
Object
.
assign
({
url
:
{
url
:
{
type
:
String
,
type
:
String
,
required
:
true
,
required
:
true
,
validator
:
createValidator
(
type
)
validator
:
createValidator
(
type
)
},
},
beforeAll
()
{
beforeAll
()
{
navigatorLock
=
''
;
navigatorLock
=
''
;
}
}
},
extras
)
},
extras
)
}
}
function
createAnimationProtocol
(
animationTypes
)
{
function
createAnimationProtocol
(
animationTypes
)
{
return
{
return
{
animationType
:
{
animationType
:
{
type
:
String
,
type
:
String
,
validator
(
type
)
{
validator
(
type
)
{
if
(
type
&&
animationTypes
.
indexOf
(
type
)
===
-
1
)
{
if
(
type
&&
animationTypes
.
indexOf
(
type
)
===
-
1
)
{
return
'
`
'
+
type
+
'
` is not supported for `animationType` (supported values are: `
'
+
animationTypes
.
join
(
return
'
`
'
+
type
+
'
` is not supported for `animationType` (supported values are: `
'
+
animationTypes
.
join
(
'
`|`
'
)
+
'
`)
'
'
`|`
'
)
+
'
`)
'
...
@@ -1786,7 +1787,7 @@ var serviceContext = (function () {
...
@@ -1786,7 +1787,7 @@ var serviceContext = (function () {
const
navigateBack
=
Object
.
assign
({
const
navigateBack
=
Object
.
assign
({
delta
:
{
delta
:
{
type
:
Number
,
type
:
Number
,
validator
(
delta
,
params
)
{
validator
(
delta
,
params
)
{
delta
=
parseInt
(
delta
)
||
1
;
delta
=
parseInt
(
delta
)
||
1
;
params
.
delta
=
Math
.
min
(
getCurrentPages
().
length
-
1
,
delta
);
params
.
delta
=
Math
.
min
(
getCurrentPages
().
length
-
1
,
delta
);
}
}
...
@@ -8373,7 +8374,7 @@ var serviceContext = (function () {
...
@@ -8373,7 +8374,7 @@ var serviceContext = (function () {
const
pages
=
[];
const
pages
=
[];
function
getCurrentPages$1
(
returnAll
)
{
function
getCurrentPages$1
(
returnAll
)
{
return
returnAll
?
pages
.
slice
(
0
)
:
pages
.
filter
(
page
=>
{
return
returnAll
?
pages
.
slice
(
0
)
:
pages
.
filter
(
page
=>
{
return
!
page
.
$page
.
meta
.
isTabBar
||
page
.
$page
.
meta
.
visible
return
!
page
.
$page
.
meta
.
isTabBar
||
page
.
$page
.
meta
.
visible
})
})
...
@@ -8381,7 +8382,7 @@ var serviceContext = (function () {
...
@@ -8381,7 +8382,7 @@ var serviceContext = (function () {
const
preloadWebviews
=
{};
const
preloadWebviews
=
{};
function
preloadWebview$1
({
function
preloadWebview$1
({
url
,
url
,
path
,
path
,
query
query
...
@@ -8399,7 +8400,7 @@ var serviceContext = (function () {
...
@@ -8399,7 +8400,7 @@ var serviceContext = (function () {
/**
/**
* 首页需要主动registerPage,二级页面路由跳转时registerPage
* 首页需要主动registerPage,二级页面路由跳转时registerPage
*/
*/
function
registerPage
({
function
registerPage
({
url
,
url
,
path
,
path
,
query
,
query
,
...
@@ -8452,7 +8453,7 @@ var serviceContext = (function () {
...
@@ -8452,7 +8453,7 @@ var serviceContext = (function () {
const
pageInstance
=
{
const
pageInstance
=
{
route
,
route
,
options
:
Object
.
assign
({},
query
||
{}),
options
:
Object
.
assign
({},
query
||
{}),
$getAppWebview
()
{
$getAppWebview
()
{
// 重要,不能直接返回 webview 对象,因为 plus 可能会被二次替换,返回的 webview 对象内部的 plus 不正确
// 重要,不能直接返回 webview 对象,因为 plus 可能会被二次替换,返回的 webview 对象内部的 plus 不正确
// 导致 webview.getStyle 等逻辑出错(旧的 webview 内部 plus 被释放)
// 导致 webview.getStyle 等逻辑出错(旧的 webview 内部 plus 被释放)
return
plus
.
webview
.
getWebviewById
(
webview
.
id
)
return
plus
.
webview
.
getWebviewById
(
webview
.
id
)
...
@@ -8464,7 +8465,7 @@ var serviceContext = (function () {
...
@@ -8464,7 +8465,7 @@ var serviceContext = (function () {
route
,
route
,
openType
openType
},
},
$remove
()
{
$remove
()
{
const
index
=
pages
.
findIndex
(
page
=>
page
===
this
);
const
index
=
pages
.
findIndex
(
page
=>
page
===
this
);
if
(
index
!==
-
1
)
{
if
(
index
!==
-
1
)
{
if
(
!
webview
.
nvue
)
{
if
(
!
webview
.
nvue
)
{
...
@@ -8477,10 +8478,10 @@ var serviceContext = (function () {
...
@@ -8477,10 +8478,10 @@ var serviceContext = (function () {
}
}
},
},
// 兼容小程序框架
// 兼容小程序框架
selectComponent
(
selector
)
{
selectComponent
(
selector
)
{
return
this
.
$vm
.
selectComponent
(
selector
)
return
this
.
$vm
.
selectComponent
(
selector
)
},
},
selectAllComponents
(
selector
)
{
selectAllComponents
(
selector
)
{
return
this
.
$vm
.
selectAllComponents
(
selector
)
return
this
.
$vm
.
selectAllComponents
(
selector
)
}
}
};
};
...
@@ -8500,7 +8501,7 @@ var serviceContext = (function () {
...
@@ -8500,7 +8501,7 @@ var serviceContext = (function () {
)
{
)
{
plus
.
navigator
.
closeSplashscreen
();
plus
.
navigator
.
closeSplashscreen
();
}
}
__uniConfig
.
onReady
(
function
()
{
__uniConfig
.
onReady
(
function
()
{
navigateFinish
();
navigateFinish
();
});
});
}
}
...
@@ -8780,7 +8781,7 @@ var serviceContext = (function () {
...
@@ -8780,7 +8781,7 @@ var serviceContext = (function () {
},
openType
===
'
appLaunch
'
);
},
openType
===
'
appLaunch
'
);
}
}
function
preloadPage$1
({
function
preloadPage$1
({
url
url
},
callbackId
)
{
},
callbackId
)
{
const
urls
=
url
.
split
(
'
?
'
);
const
urls
=
url
.
split
(
'
?
'
);
...
@@ -11869,6 +11870,35 @@ var serviceContext = (function () {
...
@@ -11869,6 +11870,35 @@ var serviceContext = (function () {
onSocketClose
:
onSocketClose
onSocketClose
:
onSocketClose
});
});
class
UpdateManager
{
onCheckForUpdate
()
{
}
onUpdateReady
()
{
}
onUpdateFailed
()
{
}
applyUpdate
()
{
}
}
let
updateManager
;
function
getUpdateManager
()
{
return
updateManager
||
(
updateManager
=
new
UpdateManager
())
}
var
require_context_module_1_20
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
getUpdateManager
:
getUpdateManager
});
class
UploadTask
{
class
UploadTask
{
constructor
(
uploadTaskId
,
callbackId
)
{
constructor
(
uploadTaskId
,
callbackId
)
{
this
.
id
=
uploadTaskId
;
this
.
id
=
uploadTaskId
;
...
@@ -11958,7 +11988,7 @@ var serviceContext = (function () {
...
@@ -11958,7 +11988,7 @@ var serviceContext = (function () {
return
task
return
task
}
}
var
require_context_module_1_2
0
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
1
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
uploadFile
:
uploadFile$1
uploadFile
:
uploadFile$1
});
});
...
@@ -12047,7 +12077,7 @@ var serviceContext = (function () {
...
@@ -12047,7 +12077,7 @@ var serviceContext = (function () {
return
new
MPAnimation
(
option
)
return
new
MPAnimation
(
option
)
}
}
var
require_context_module_1_2
1
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
2
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
createAnimation
:
createAnimation
createAnimation
:
createAnimation
});
});
...
@@ -12117,7 +12147,7 @@ var serviceContext = (function () {
...
@@ -12117,7 +12147,7 @@ var serviceContext = (function () {
return
new
ServiceIntersectionObserver
(
getCurrentPageVm
(
'
createIntersectionObserver
'
),
options
)
return
new
ServiceIntersectionObserver
(
getCurrentPageVm
(
'
createIntersectionObserver
'
),
options
)
}
}
var
require_context_module_1_2
2
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
3
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
createIntersectionObserver
:
createIntersectionObserver
createIntersectionObserver
:
createIntersectionObserver
});
});
...
@@ -12258,7 +12288,7 @@ var serviceContext = (function () {
...
@@ -12258,7 +12288,7 @@ var serviceContext = (function () {
return
new
SelectorQuery
(
getCurrentPageVm
(
'
createSelectorQuery
'
))
return
new
SelectorQuery
(
getCurrentPageVm
(
'
createSelectorQuery
'
))
}
}
var
require_context_module_1_2
3
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
4
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
createSelectorQuery
:
createSelectorQuery
createSelectorQuery
:
createSelectorQuery
});
});
...
@@ -12275,7 +12305,7 @@ var serviceContext = (function () {
...
@@ -12275,7 +12305,7 @@ var serviceContext = (function () {
callback$1
=
callbackId
;
callback$1
=
callbackId
;
}
}
var
require_context_module_1_2
4
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
5
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
onKeyboardHeightChange
:
onKeyboardHeightChange
onKeyboardHeightChange
:
onKeyboardHeightChange
});
});
...
@@ -12300,7 +12330,7 @@ var serviceContext = (function () {
...
@@ -12300,7 +12330,7 @@ var serviceContext = (function () {
},
pageId
);
},
pageId
);
}
}
var
require_context_module_1_2
5
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
6
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
loadFontFace
:
loadFontFace$1
loadFontFace
:
loadFontFace$1
});
});
...
@@ -12313,7 +12343,7 @@ var serviceContext = (function () {
...
@@ -12313,7 +12343,7 @@ var serviceContext = (function () {
return
{}
return
{}
}
}
var
require_context_module_1_2
6
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
7
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
pageScrollTo
:
pageScrollTo$1
pageScrollTo
:
pageScrollTo$1
});
});
...
@@ -12326,7 +12356,7 @@ var serviceContext = (function () {
...
@@ -12326,7 +12356,7 @@ var serviceContext = (function () {
return
{}
return
{}
}
}
var
require_context_module_1_2
7
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
8
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
setPageMeta
:
setPageMeta
setPageMeta
:
setPageMeta
});
});
...
@@ -12363,7 +12393,7 @@ var serviceContext = (function () {
...
@@ -12363,7 +12393,7 @@ var serviceContext = (function () {
callbacks$c
.
push
(
callbackId
);
callbacks$c
.
push
(
callbackId
);
}
}
var
require_context_module_1_2
8
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_2
9
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
removeTabBarBadge
:
removeTabBarBadge$1
,
removeTabBarBadge
:
removeTabBarBadge$1
,
showTabBarRedDot
:
showTabBarRedDot$1
,
showTabBarRedDot
:
showTabBarRedDot$1
,
...
@@ -12389,7 +12419,7 @@ var serviceContext = (function () {
...
@@ -12389,7 +12419,7 @@ var serviceContext = (function () {
callbacks$d
.
splice
(
callbacks$d
.
indexOf
(
callbackId
),
1
);
callbacks$d
.
splice
(
callbacks$d
.
indexOf
(
callbackId
),
1
);
}
}
var
require_context_module_1_
29
=
/*#__PURE__*/
Object
.
freeze
({
var
require_context_module_1_
30
=
/*#__PURE__*/
Object
.
freeze
({
__proto__
:
null
,
__proto__
:
null
,
onWindowResize
:
onWindowResize
,
onWindowResize
:
onWindowResize
,
offWindowResize
:
offWindowResize
offWindowResize
:
offWindowResize
...
@@ -12420,16 +12450,17 @@ var serviceContext = (function () {
...
@@ -12420,16 +12450,17 @@ var serviceContext = (function () {
'
./network/download-file.js
'
:
require_context_module_1_17
,
'
./network/download-file.js
'
:
require_context_module_1_17
,
'
./network/request.js
'
:
require_context_module_1_18
,
'
./network/request.js
'
:
require_context_module_1_18
,
'
./network/socket.js
'
:
require_context_module_1_19
,
'
./network/socket.js
'
:
require_context_module_1_19
,
'
./network/upload-file.js
'
:
require_context_module_1_20
,
'
./network/update.js
'
:
require_context_module_1_20
,
'
./ui/create-animation.js
'
:
require_context_module_1_21
,
'
./network/upload-file.js
'
:
require_context_module_1_21
,
'
./ui/create-intersection-observer.js
'
:
require_context_module_1_22
,
'
./ui/create-animation.js
'
:
require_context_module_1_22
,
'
./ui/create-selector-query.js
'
:
require_context_module_1_23
,
'
./ui/create-intersection-observer.js
'
:
require_context_module_1_23
,
'
./ui/keyboard.js
'
:
require_context_module_1_24
,
'
./ui/create-selector-query.js
'
:
require_context_module_1_24
,
'
./ui/load-font-face.js
'
:
require_context_module_1_25
,
'
./ui/keyboard.js
'
:
require_context_module_1_25
,
'
./ui/page-scroll-to.js
'
:
require_context_module_1_26
,
'
./ui/load-font-face.js
'
:
require_context_module_1_26
,
'
./ui/set-page-meta.js
'
:
require_context_module_1_27
,
'
./ui/page-scroll-to.js
'
:
require_context_module_1_27
,
'
./ui/tab-bar.js
'
:
require_context_module_1_28
,
'
./ui/set-page-meta.js
'
:
require_context_module_1_28
,
'
./ui/window.js
'
:
require_context_module_1_29
,
'
./ui/tab-bar.js
'
:
require_context_module_1_29
,
'
./ui/window.js
'
:
require_context_module_1_30
,
};
};
var
req
=
function
req
(
key
)
{
var
req
=
function
req
(
key
)
{
...
@@ -13352,9 +13383,10 @@ var serviceContext = (function () {
...
@@ -13352,9 +13383,10 @@ var serviceContext = (function () {
}
}
class
VDomSync
{
class
VDomSync
{
constructor
(
pageId
,
pagePath
,
pageVm
)
{
constructor
(
pageId
,
pagePath
,
page
Query
,
page
Vm
)
{
this
.
pageId
=
pageId
;
this
.
pageId
=
pageId
;
this
.
pagePath
=
pagePath
;
this
.
pagePath
=
pagePath
;
this
.
pageQuery
=
pageQuery
;
this
.
pageVm
=
pageVm
;
this
.
pageVm
=
pageVm
;
this
.
batchData
=
[];
this
.
batchData
=
[];
this
.
vms
=
Object
.
create
(
null
);
this
.
vms
=
Object
.
create
(
null
);
...
@@ -13451,7 +13483,7 @@ var serviceContext = (function () {
...
@@ -13451,7 +13483,7 @@ var serviceContext = (function () {
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
,
this
.
pageQuery
]]);
}
}
const
batchData
=
this
.
batchData
.
filter
(
data
=>
{
const
batchData
=
this
.
batchData
.
filter
(
data
=>
{
if
(
data
[
0
]
===
UPDATED_DATA
&&
!
Object
.
keys
(
data
[
1
][
1
]).
length
)
{
if
(
data
[
0
]
===
UPDATED_DATA
&&
!
Object
.
keys
(
data
[
1
][
1
]).
length
)
{
...
@@ -13486,7 +13518,7 @@ var serviceContext = (function () {
...
@@ -13486,7 +13518,7 @@ var serviceContext = (function () {
}
}
restorePageCreated
()
{
restorePageCreated
()
{
this
.
batchData
.
push
([
PAGE_CREATED
,
[
this
.
pageId
,
this
.
pagePath
]]);
this
.
batchData
.
push
([
PAGE_CREATED
,
[
this
.
pageId
,
this
.
pagePath
,
this
.
pageQuery
]]);
}
}
restore
()
{
restore
()
{
...
@@ -13608,7 +13640,7 @@ var serviceContext = (function () {
...
@@ -13608,7 +13640,7 @@ var serviceContext = (function () {
return
return
}
}
if
(
this
.
mpType
===
'
page
'
)
{
if
(
this
.
mpType
===
'
page
'
)
{
this
.
_$vdomSync
=
new
VDomSync
(
this
.
$options
.
pageId
,
this
.
$options
.
pagePath
,
this
);
this
.
_$vdomSync
=
new
VDomSync
(
this
.
$options
.
pageId
,
this
.
$options
.
pagePath
,
this
.
$options
.
pageQuery
,
this
);
}
}
if
(
this
.
_$vd
)
{
if
(
this
.
_$vd
)
{
this
.
_$id
=
generateId
(
this
,
this
.
$parent
);
this
.
_$id
=
generateId
(
this
,
this
.
$parent
);
...
...
packages/uni-app-plus/dist/view.umd.min.js
浏览文件 @
dcadcc5e
此差异已折叠。
点击以展开。
packages/uni-h5/dist/index.umd.min.js
浏览文件 @
dcadcc5e
此差异已折叠。
点击以展开。
packages/uni-h5/manifest.json
浏览文件 @
dcadcc5e
...
@@ -105,6 +105,10 @@
...
@@ -105,6 +105,10 @@
"/platforms/h5/service/api/network/socket.js"
,
"/platforms/h5/service/api/network/socket.js"
,
[]
[]
],
],
"getUpdateManager"
:
[
"/core/service/api/network/update.js"
,
[]
],
"navigateTo"
:
[
"navigateTo"
:
[
"/platforms/h5/service/api/route/route.js"
,
"/platforms/h5/service/api/route/route.js"
,
[
[
...
...
src/core/view/plugins/index.js
浏览文件 @
dcadcc5e
...
@@ -48,10 +48,16 @@ export default {
...
@@ -48,10 +48,16 @@ export default {
return
$event
return
$event
}
}
Vue
.
prototype
.
$getComponentDescriptor
=
function
(
vm
,
isOwnerInstance
)
{
Vue
.
prototype
.
$getComponentDescriptor
=
function
(
vm
,
isOwnerInstance
)
{
return
createComponentDescriptor
(
vm
||
this
,
isOwnerInstance
)
return
createComponentDescriptor
(
vm
||
this
,
isOwnerInstance
)
}
}
Object
.
defineProperty
(
Vue
.
prototype
,
'
$ownerInstance
'
,
{
get
()
{
return
this
.
$getComponentDescriptor
(
this
)
}
})
Vue
.
prototype
.
$handleWxsEvent
=
function
(
$event
)
{
Vue
.
prototype
.
$handleWxsEvent
=
function
(
$event
)
{
if
(
$event
instanceof
Event
)
{
// 未处理的 event 对象 需要对 target 校正及包装
if
(
$event
instanceof
Event
)
{
// 未处理的 event 对象 需要对 target 校正及包装
const
currentTarget
=
$event
.
currentTarget
const
currentTarget
=
$event
.
currentTarget
...
@@ -80,12 +86,11 @@ export default {
...
@@ -80,12 +86,11 @@ export default {
initBehaviors
(
options
,
this
)
initBehaviors
(
options
,
this
)
}
}
if
(
isPage
(
this
))
{
if
(
__PLATFORM__
===
'
h5
'
&&
isPage
(
this
))
{
options
.
mounted
=
options
.
mounted
?
[].
concat
(
pageMounted
,
options
.
mounted
)
:
[
pageMounted
]
options
.
mounted
=
options
.
mounted
?
[].
concat
(
pageMounted
,
options
.
mounted
)
:
[
pageMounted
]
}
}
}
}
})
})
// TODO 跨平台时,View 层需要注入$page属性
}
}
}
}
src/platforms/app-plus/service/framework/plugins/data.js
浏览文件 @
dcadcc5e
...
@@ -21,7 +21,7 @@ import {
...
@@ -21,7 +21,7 @@ import {
B_CLASS
,
B_CLASS
,
B_STYLE
,
B_STYLE
,
S_CLASS
S_CLASS
}
from
'
../../constants
'
}
from
'
../../constants
'
import
{
import
{
generateId
generateId
...
@@ -85,7 +85,7 @@ export function initData (Vue) {
...
@@ -85,7 +85,7 @@ export function initData (Vue) {
return
return
}
}
if
(
this
.
mpType
===
'
page
'
)
{
if
(
this
.
mpType
===
'
page
'
)
{
this
.
_$vdomSync
=
new
VDomSync
(
this
.
$options
.
pageId
,
this
.
$options
.
pagePath
,
this
)
this
.
_$vdomSync
=
new
VDomSync
(
this
.
$options
.
pageId
,
this
.
$options
.
pagePath
,
this
.
$options
.
pageQuery
,
this
)
}
}
if
(
this
.
_$vd
)
{
if
(
this
.
_$vd
)
{
this
.
_$id
=
generateId
(
this
,
this
.
$parent
)
this
.
_$id
=
generateId
(
this
,
this
.
$parent
)
...
...
src/platforms/app-plus/service/framework/plugins/vdom-sync.js
浏览文件 @
dcadcc5e
...
@@ -90,9 +90,10 @@ function onVdSync (vdBatchData, vd) {
...
@@ -90,9 +90,10 @@ function onVdSync (vdBatchData, vd) {
}
}
export
class
VDomSync
{
export
class
VDomSync
{
constructor
(
pageId
,
pagePath
,
pageVm
)
{
constructor
(
pageId
,
pagePath
,
page
Query
,
page
Vm
)
{
this
.
pageId
=
pageId
this
.
pageId
=
pageId
this
.
pagePath
=
pagePath
this
.
pagePath
=
pagePath
this
.
pageQuery
=
pageQuery
this
.
pageVm
=
pageVm
this
.
pageVm
=
pageVm
this
.
batchData
=
[]
this
.
batchData
=
[]
this
.
vms
=
Object
.
create
(
null
)
this
.
vms
=
Object
.
create
(
null
)
...
@@ -189,7 +190,7 @@ export class VDomSync {
...
@@ -189,7 +190,7 @@ export class VDomSync {
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
,
this
.
pageQuery
]])
}
}
const
batchData
=
this
.
batchData
.
filter
(
data
=>
{
const
batchData
=
this
.
batchData
.
filter
(
data
=>
{
if
(
data
[
0
]
===
UPDATED_DATA
&&
!
Object
.
keys
(
data
[
1
][
1
]).
length
)
{
if
(
data
[
0
]
===
UPDATED_DATA
&&
!
Object
.
keys
(
data
[
1
][
1
]).
length
)
{
...
@@ -224,7 +225,7 @@ export class VDomSync {
...
@@ -224,7 +225,7 @@ export class VDomSync {
}
}
restorePageCreated
()
{
restorePageCreated
()
{
this
.
batchData
.
push
([
PAGE_CREATED
,
[
this
.
pageId
,
this
.
pagePath
]])
this
.
batchData
.
push
([
PAGE_CREATED
,
[
this
.
pageId
,
this
.
pagePath
,
this
.
pageQuery
]])
}
}
restore
()
{
restore
()
{
...
...
src/platforms/app-plus/view/framework/plugins/data.js
浏览文件 @
dcadcc5e
...
@@ -52,12 +52,14 @@ const handleData = {
...
@@ -52,12 +52,14 @@ const handleData = {
vd
.
updateVData
.
apply
(
vd
,
data
)
vd
.
updateVData
.
apply
(
vd
,
data
)
},
},
[
PAGE_CREATED
]:
function
onPageCreated
(
data
)
{
[
PAGE_CREATED
]:
function
onPageCreated
(
data
)
{
const
[
pageId
,
pagePath
]
=
data
const
[
pageId
,
pagePath
,
pageQuery
]
=
data
const
page
=
getCurrentPages
()[
0
]
const
page
=
getCurrentPages
()[
0
]
page
.
options
=
pageQuery
||
{}
page
.
$vm
=
new
PageVueComponent
({
page
.
$vm
=
new
PageVueComponent
({
mpType
:
'
page
'
,
mpType
:
'
page
'
,
pageId
,
pageId
,
pagePath
pagePath
,
pageQuery
}).
$mount
(
'
#app
'
)
}).
$mount
(
'
#app
'
)
}
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录