提交 f7647139 编写于 作者: fxy060608's avatar fxy060608

feat(v3): preload

上级 e006a832
......@@ -12142,7 +12142,7 @@ var serviceContext = (function () {
}
abort () {
invokeMethod('operateRequestTask', {
invokeMethod('operateUploadTask', {
uploadTaskId: this.id,
operationType: 'abort'
});
......@@ -14208,6 +14208,20 @@ var serviceContext = (function () {
Vue.prototype.$mount = function mount (el, hydrating) {
if (this.mpType === 'app') {
this.$options.render = function () {};
if (weex.config.preload) { // preload
if (process.env.NODE_ENV !== 'production') {
console.log('[uni-app] preload app-service.js');
}
const globalEvent = weex.requireModule('globalEvent');
globalEvent.addEventListener('launchApp', () => {
if (process.env.NODE_ENV !== 'production') {
console.log('[uni-app] launchApp');
}
registerApp(this);
oldMount.call(this, el, hydrating);
});
return
}
registerApp(this);
}
return oldMount.call(this, el, hydrating)
......
......@@ -47,6 +47,20 @@ export default {
Vue.prototype.$mount = function mount (el, hydrating) {
if (this.mpType === 'app') {
this.$options.render = function () {}
if (weex.config.preload) { // preload
if (process.env.NODE_ENV !== 'production') {
console.log('[uni-app] preload app-service.js')
}
const globalEvent = weex.requireModule('globalEvent')
globalEvent.addEventListener('launchApp', () => {
if (process.env.NODE_ENV !== 'production') {
console.log('[uni-app] launchApp')
}
registerApp(this)
oldMount.call(this, el, hydrating)
})
return
}
registerApp(this)
}
return oldMount.call(this, el, hydrating)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册