Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_68066342
uni-app
提交
6251997d
U
uni-app
项目概览
m0_68066342
/
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,发现更多精彩内容 >>
提交
6251997d
编写于
2月 02, 2021
作者:
Q
qiang
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'dev' into alpha
上级
ad1362c8
2535ce7a
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
508 addition
and
263 deletion
+508
-263
packages/uni-app-plus/dist/index.js
packages/uni-app-plus/dist/index.js
+124
-98
packages/uni-mp-alipay/dist/index.js
packages/uni-mp-alipay/dist/index.js
+43
-17
packages/uni-mp-baidu/dist/index.js
packages/uni-mp-baidu/dist/index.js
+43
-17
packages/uni-mp-kuaishou/dist/index.js
packages/uni-mp-kuaishou/dist/index.js
+43
-17
packages/uni-mp-qq/dist/index.js
packages/uni-mp-qq/dist/index.js
+43
-17
packages/uni-mp-toutiao/dist/index.js
packages/uni-mp-toutiao/dist/index.js
+43
-17
packages/uni-mp-weixin/dist/index.js
packages/uni-mp-weixin/dist/index.js
+56
-30
packages/uni-quickapp-webview/dist/index.js
packages/uni-quickapp-webview/dist/index.js
+43
-17
packages/vue-cli-plugin-hbuilderx/packages/weex-styler/lib/shorthand-parser.js
...in-hbuilderx/packages/weex-styler/lib/shorthand-parser.js
+1
-1
packages/vue-cli-plugin-uni/lib/mp/index.js
packages/vue-cli-plugin-uni/lib/mp/index.js
+5
-1
src/core/runtime/index.js
src/core/runtime/index.js
+5
-2
src/core/runtime/wrapper/create-app.js
src/core/runtime/wrapper/create-app.js
+1
-27
src/core/runtime/wrapper/create-subpackage-app.js
src/core/runtime/wrapper/create-subpackage-app.js
+28
-0
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
+30
-2
未找到文件。
packages/uni-app-plus/dist/index.js
浏览文件 @
6251997d
...
...
@@ -639,74 +639,6 @@ if (!MPPage.__$wrappered) {
};
}
class
EventChannel
{
constructor
(
id
,
events
)
{
this
.
id
=
id
;
this
.
listener
=
{};
this
.
emitCache
=
{};
if
(
events
)
{
Object
.
keys
(
events
).
forEach
(
name
=>
{
this
.
on
(
name
,
events
[
name
]);
});
}
}
emit
(
eventName
,
...
args
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
(
this
.
emitCache
[
eventName
]
||
(
this
.
emitCache
[
eventName
]
=
[])).
push
(
args
)
}
fns
.
forEach
(
opt
=>
{
opt
.
fn
.
apply
(
opt
.
fn
,
args
);
});
this
.
listener
[
eventName
]
=
fns
.
filter
(
opt
=>
opt
.
type
!==
'
once
'
);
}
on
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
on
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
once
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
once
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
off
(
eventName
,
fn
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
}
if
(
fn
)
{
for
(
let
i
=
0
;
i
<
fns
.
length
;)
{
if
(
fns
[
i
].
fn
===
fn
)
{
fns
.
splice
(
i
,
1
);
i
--
;
}
i
++
;
}
}
else
{
delete
this
.
listener
[
eventName
];
}
}
_clearCache
(
eventName
)
{
const
cacheArgs
=
this
.
emitCache
[
eventName
];
if
(
cacheArgs
)
{
for
(;
cacheArgs
.
length
>
0
;)
{
this
.
emit
.
apply
(
this
,
[
eventName
].
concat
(
cacheArgs
.
shift
()));
}
}
}
_addListener
(
eventName
,
type
,
fn
)
{
(
this
.
listener
[
eventName
]
||
(
this
.
listener
[
eventName
]
=
[])).
push
({
fn
,
type
});
}
}
const
PAGE_EVENT_HOOKS
=
[
'
onPullDownRefresh
'
,
'
onReachBottom
'
,
...
...
@@ -1245,19 +1177,118 @@ function handleEvent (event) {
}
}
class
EventChannel
{
constructor
(
id
,
events
)
{
this
.
id
=
id
;
this
.
listener
=
{};
this
.
emitCache
=
{};
if
(
events
)
{
Object
.
keys
(
events
).
forEach
(
name
=>
{
this
.
on
(
name
,
events
[
name
]);
});
}
}
emit
(
eventName
,
...
args
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
(
this
.
emitCache
[
eventName
]
||
(
this
.
emitCache
[
eventName
]
=
[])).
push
(
args
)
}
fns
.
forEach
(
opt
=>
{
opt
.
fn
.
apply
(
opt
.
fn
,
args
);
});
this
.
listener
[
eventName
]
=
fns
.
filter
(
opt
=>
opt
.
type
!==
'
once
'
);
}
on
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
on
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
once
(
eventName
,
fn
)
{
this
.
_addListener
(
eventName
,
'
once
'
,
fn
);
this
.
_clearCache
(
eventName
);
}
off
(
eventName
,
fn
)
{
const
fns
=
this
.
listener
[
eventName
];
if
(
!
fns
)
{
return
}
if
(
fn
)
{
for
(
let
i
=
0
;
i
<
fns
.
length
;)
{
if
(
fns
[
i
].
fn
===
fn
)
{
fns
.
splice
(
i
,
1
);
i
--
;
}
i
++
;
}
}
else
{
delete
this
.
listener
[
eventName
];
}
}
_clearCache
(
eventName
)
{
const
cacheArgs
=
this
.
emitCache
[
eventName
];
if
(
cacheArgs
)
{
for
(;
cacheArgs
.
length
>
0
;)
{
this
.
emit
.
apply
(
this
,
[
eventName
].
concat
(
cacheArgs
.
shift
()));
}
}
}
_addListener
(
eventName
,
type
,
fn
)
{
(
this
.
listener
[
eventName
]
||
(
this
.
listener
[
eventName
]
=
[])).
push
({
fn
,
type
});
}
}
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
if
(
id
)
{
const
eventChannel
=
eventChannels
[
id
];
delete
eventChannels
[
id
];
return
eventChannel
}
return
eventChannelStack
.
shift
()
}
const
hooks
=
[
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
initEventChannel
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
}
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel
();
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
;
}
...
...
@@ -1426,34 +1457,7 @@ function parseApp$1 (vm) {
return
appOptions
}
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
if
(
id
)
{
const
eventChannel
=
eventChannels
[
id
];
delete
eventChannels
[
id
];
return
eventChannel
}
return
eventChannelStack
.
shift
()
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp$1
(
vm
));
return
vm
}
...
...
@@ -1675,6 +1679,27 @@ function createComponent (vueOptions) {
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp$1
(
vm
);
const
app
=
getApp
({
allowDefault
:
true
});
const
globalData
=
app
.
globalData
;
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
];
}
});
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
];
}
});
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -1744,8 +1769,9 @@ if (typeof Proxy !== 'undefined' && "app-plus" !== 'app-plus') {
wx
.
createApp
=
createApp
;
wx
.
createPage
=
createPage
;
wx
.
createComponent
=
createComponent
;
wx
.
createSubpackageApp
=
createSubpackageApp
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
};
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-alipay/dist/index.js
浏览文件 @
6251997d
...
...
@@ -1904,15 +1904,33 @@ const hooks = [
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
initEventChannel$1
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
}
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel$1
();
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
;
}
...
...
@@ -2316,20 +2334,6 @@ function parseApp (vm) {
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp
(
vm
));
return
vm
}
...
...
@@ -2588,6 +2592,27 @@ function createComponent (vueOptions) {
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp
(
vm
);
const
app
=
getApp
({
allowDefault
:
true
});
const
globalData
=
app
.
globalData
;
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
];
}
});
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
];
}
});
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -2667,8 +2692,9 @@ if (typeof Proxy !== 'undefined' && "mp-alipay" !== 'app-plus') {
my
.
createApp
=
createApp
;
my
.
createPage
=
createPage
;
my
.
createComponent
=
createComponent
;
my
.
createSubpackageApp
=
createSubpackageApp
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
};
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-baidu/dist/index.js
浏览文件 @
6251997d
...
...
@@ -1593,15 +1593,33 @@ const hooks = [
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
initEventChannel$1
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
}
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel$1
();
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
;
}
...
...
@@ -1769,20 +1787,6 @@ function parseApp (vm) {
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp
(
vm
));
return
vm
}
...
...
@@ -2074,6 +2078,27 @@ function createComponent (vueOptions) {
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp
(
vm
);
const
app
=
getApp
({
allowDefault
:
true
});
const
globalData
=
app
.
globalData
;
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
];
}
});
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
];
}
});
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -2153,8 +2178,9 @@ if (typeof Proxy !== 'undefined' && "mp-baidu" !== 'app-plus') {
swan
.
createApp
=
createApp
;
swan
.
createPage
=
createPage
;
swan
.
createComponent
=
createComponent
;
swan
.
createSubpackageApp
=
createSubpackageApp
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
};
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-kuaishou/dist/index.js
浏览文件 @
6251997d
...
...
@@ -1345,15 +1345,33 @@ const hooks = [
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
initEventChannel$1
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
}
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel$1
();
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
;
}
...
...
@@ -1515,20 +1533,6 @@ function parseApp$1 (vm) {
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp$1
(
vm
));
return
vm
}
...
...
@@ -1732,6 +1736,27 @@ function createComponent (vueOptions) {
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp$1
(
vm
);
const
app
=
getApp
({
allowDefault
:
true
});
const
globalData
=
app
.
globalData
;
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
];
}
});
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
];
}
});
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -1811,8 +1836,9 @@ if (typeof Proxy !== 'undefined' && "mp-kuaishou" !== 'app-plus') {
ks
.
createApp
=
createApp
;
ks
.
createPage
=
createPage
;
ks
.
createComponent
=
createComponent
;
ks
.
createSubpackageApp
=
createSubpackageApp
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
};
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-qq/dist/index.js
浏览文件 @
6251997d
...
...
@@ -1506,15 +1506,33 @@ const hooks = [
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
initEventChannel$1
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
}
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel$1
();
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
;
}
...
...
@@ -1681,20 +1699,6 @@ function parseApp$1 (vm) {
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp$1
(
vm
));
return
vm
}
...
...
@@ -1905,6 +1909,27 @@ function createComponent (vueOptions) {
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp$1
(
vm
);
const
app
=
getApp
({
allowDefault
:
true
});
const
globalData
=
app
.
globalData
;
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
];
}
});
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
];
}
});
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -1984,8 +2009,9 @@ if (typeof Proxy !== 'undefined' && "mp-qq" !== 'app-plus') {
wx
.
createApp
=
createApp
;
wx
.
createPage
=
createPage
;
wx
.
createComponent
=
createComponent
;
wx
.
createSubpackageApp
=
createSubpackageApp
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
};
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-toutiao/dist/index.js
浏览文件 @
6251997d
...
...
@@ -1598,15 +1598,33 @@ const hooks = [
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
initEventChannel$1
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
}
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel$1
();
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
;
}
...
...
@@ -1848,20 +1866,6 @@ function parseApp (vm) {
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp
(
vm
));
return
vm
}
...
...
@@ -2113,6 +2117,27 @@ function createComponent (vueOptions) {
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp
(
vm
);
const
app
=
getApp
({
allowDefault
:
true
});
const
globalData
=
app
.
globalData
;
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
];
}
});
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
];
}
});
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -2192,8 +2217,9 @@ if (typeof Proxy !== 'undefined' && "mp-toutiao" !== 'app-plus') {
tt
.
createApp
=
createApp
;
tt
.
createPage
=
createPage
;
tt
.
createComponent
=
createComponent
;
tt
.
createSubpackageApp
=
createSubpackageApp
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
};
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-mp-weixin/dist/index.js
浏览文件 @
6251997d
...
...
@@ -1246,19 +1246,50 @@ function handleEvent (event) {
}
}
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
if
(
id
)
{
const
eventChannel
=
eventChannels
[
id
];
delete
eventChannels
[
id
];
return
eventChannel
}
return
eventChannelStack
.
shift
()
}
const
hooks
=
[
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
initEventChannel
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
// 微信小程序使用自身getOpenerEventChannel
{
return
this
.
$scope
.
getOpenerEventChannel
()
}
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
}
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel
();
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
;
}
...
...
@@ -1427,34 +1458,7 @@ function parseApp (vm) {
})
}
const
eventChannels
=
{};
const
eventChannelStack
=
[];
function
getEventChannel
(
id
)
{
if
(
id
)
{
const
eventChannel
=
eventChannels
[
id
];
delete
eventChannels
[
id
];
return
eventChannel
}
return
eventChannelStack
.
shift
()
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
// 微信小程序使用自身getOpenerEventChannel
{
return
this
.
$scope
.
getOpenerEventChannel
()
}
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp
(
vm
));
return
vm
}
...
...
@@ -1657,6 +1661,27 @@ function createComponent (vueOptions) {
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp
(
vm
);
const
app
=
getApp
({
allowDefault
:
true
});
const
globalData
=
app
.
globalData
;
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
];
}
});
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
];
}
});
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -1736,8 +1761,9 @@ if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') {
wx
.
createApp
=
createApp
;
wx
.
createPage
=
createPage
;
wx
.
createComponent
=
createComponent
;
wx
.
createSubpackageApp
=
createSubpackageApp
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
};
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/uni-quickapp-webview/dist/index.js
浏览文件 @
6251997d
...
...
@@ -1320,15 +1320,33 @@ const hooks = [
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
];
function
initEventChannel$1
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
}
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel$1
();
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
;
}
...
...
@@ -1558,20 +1576,6 @@ function parseApp (vm) {
}
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
();
}
return
this
.
__eventChannel__
};
const
callHook
=
Vue
.
prototype
.
__call_hook
;
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
);
delete
args
.
__id__
;
}
return
callHook
.
call
(
this
,
hook
,
args
)
};
App
(
parseApp
(
vm
));
return
vm
}
...
...
@@ -1823,6 +1827,27 @@ function createComponent (vueOptions) {
}
}
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp
(
vm
);
const
app
=
getApp
({
allowDefault
:
true
});
const
globalData
=
app
.
globalData
;
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
];
}
});
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
];
}
});
return
vm
}
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
;
});
...
...
@@ -1902,8 +1927,9 @@ if (typeof Proxy !== 'undefined' && "quickapp-webview" !== 'app-plus') {
qa
.
createApp
=
createApp
;
qa
.
createPage
=
createPage
;
qa
.
createComponent
=
createComponent
;
qa
.
createSubpackageApp
=
createSubpackageApp
;
var
uni$1
=
uni
;
export
default
uni$1
;
export
{
createApp
,
createComponent
,
createPage
};
export
{
createApp
,
createComponent
,
createPage
,
createSubpackageApp
};
packages/vue-cli-plugin-hbuilderx/packages/weex-styler/lib/shorthand-parser.js
浏览文件 @
6251997d
...
...
@@ -76,7 +76,7 @@ function borderProperty (declaration) {
var
{
value
,
important
}
=
clearImportant
(
declaration
.
value
)
var
position
=
declaration
.
position
var
property
=
declaration
.
property
.
split
(
'
-
'
)[
1
]
var
splitResult
=
value
.
split
(
/
\s
+/
)
var
splitResult
=
value
.
replace
(
/
\s
*,
\s
*/g
,
'
,
'
).
split
(
/
\s
+/
)
var
result
=
[]
switch
(
splitResult
.
length
)
{
case
1
:
...
...
packages/vue-cli-plugin-uni/lib/mp/index.js
浏览文件 @
6251997d
...
...
@@ -36,7 +36,11 @@ function getProvides () {
}
if
(
process
.
env
.
UNI_USING_COMPONENTS
)
{
provides
.
createApp
=
[
uniPath
,
'
createApp
'
]
if
(
process
.
env
.
UNI_SUBPACKGE
)
{
provides
.
createApp
=
[
uniPath
,
'
createSubpackageApp
'
]
}
else
{
provides
.
createApp
=
[
uniPath
,
'
createApp
'
]
}
provides
.
createPage
=
[
uniPath
,
'
createPage
'
]
provides
.
createComponent
=
[
uniPath
,
'
createComponent
'
]
}
...
...
src/core/runtime/index.js
浏览文件 @
6251997d
...
...
@@ -26,7 +26,8 @@ import {
import
createApp
from
'
./wrapper/create-app
'
import
createPage
from
'
./wrapper/create-page
'
import
createComponent
from
'
./wrapper/create-component
'
import
createComponent
from
'
./wrapper/create-component
'
import
createSubpackageApp
from
'
./wrapper/create-subpackage-app
'
todos
.
forEach
(
todoApi
=>
{
protocols
[
todoApi
]
=
false
...
...
@@ -114,11 +115,13 @@ if (__PLATFORM__ === 'app-plus') {
__GLOBAL__
.
createApp
=
createApp
__GLOBAL__
.
createPage
=
createPage
__GLOBAL__
.
createComponent
=
createComponent
__GLOBAL__
.
createSubpackageApp
=
createSubpackageApp
export
{
createApp
,
createPage
,
createComponent
createComponent
,
createSubpackageApp
}
export
default
uni
src/core/runtime/wrapper/create-app.js
浏览文件 @
6251997d
import
Vue
from
'
vue
'
import
'
uni-platform/runtime/index
'
import
EventChannel
from
'
uni-helpers/EventChannel
'
import
parseApp
from
'
uni-platform/runtime/wrapper/app-parser
'
import
{
getEventChannel
}
from
'
uni-helpers/navigate-to
'
export
default
function
createApp
(
vm
)
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
// 微信小程序使用自身getOpenerEventChannel
if
(
__PLATFORM__
===
'
mp-weixin
'
)
{
return
this
.
$scope
.
getOpenerEventChannel
()
}
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
()
}
return
this
.
__eventChannel__
}
const
callHook
=
Vue
.
prototype
.
__call_hook
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
)
delete
args
.
__id__
}
return
callHook
.
call
(
this
,
hook
,
args
)
}
App
(
parseApp
(
vm
))
return
vm
}
}
src/core/runtime/wrapper/create-subpackage-app.js
0 → 100644
浏览文件 @
6251997d
import
'
uni-platform/runtime/index
'
import
{
hasOwn
}
from
'
uni-shared
'
import
parseApp
from
'
uni-platform/runtime/wrapper/app-parser
'
export
default
function
createSubpackageApp
(
vm
)
{
const
appOptions
=
parseApp
(
vm
)
const
app
=
getApp
({
allowDefault
:
true
})
const
globalData
=
app
.
globalData
if
(
globalData
)
{
Object
.
keys
(
appOptions
.
globalData
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
globalData
,
name
))
{
globalData
[
name
]
=
appOptions
.
globalData
[
name
]
}
})
}
Object
.
keys
(
appOptions
).
forEach
(
name
=>
{
if
(
!
hasOwn
(
app
,
name
))
{
app
[
name
]
=
appOptions
[
name
]
}
})
return
vm
}
src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js
浏览文件 @
6251997d
...
...
@@ -5,19 +5,47 @@ import {
initMocks
}
from
'
uni-wrapper/util
'
import
EventChannel
from
'
uni-helpers/EventChannel
'
import
{
getEventChannel
}
from
'
uni-helpers/navigate-to
'
const
hooks
=
[
'
onShow
'
,
'
onHide
'
,
'
onError
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onPageNotFound
'
,
'
onThemeChange
'
,
'
onUnhandledRejection
'
]
function
initEventChannel
()
{
Vue
.
prototype
.
getOpenerEventChannel
=
function
()
{
// 微信小程序使用自身getOpenerEventChannel
if
(
__PLATFORM__
===
'
mp-weixin
'
)
{
return
this
.
$scope
.
getOpenerEventChannel
()
}
if
(
!
this
.
__eventChannel__
)
{
this
.
__eventChannel__
=
new
EventChannel
()
}
return
this
.
__eventChannel__
}
const
callHook
=
Vue
.
prototype
.
__call_hook
Vue
.
prototype
.
__call_hook
=
function
(
hook
,
args
)
{
if
(
hook
===
'
onLoad
'
&&
args
&&
args
.
__id__
)
{
this
.
__eventChannel__
=
getEventChannel
(
args
.
__id__
)
delete
args
.
__id__
}
return
callHook
.
call
(
this
,
hook
,
args
)
}
}
export
default
function
parseBaseApp
(
vm
,
{
mocks
,
initRefs
})
{
initEventChannel
()
if
(
vm
.
$options
.
store
)
{
Vue
.
prototype
.
$store
=
vm
.
$options
.
store
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录