From 06c97d74034d3ea4bbfa5bfc7ec361933463c4ce Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Sat, 22 Jun 2019 14:27:02 +0800 Subject: [PATCH] feat(app-plus): export global.uni --- src/core/runtime/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/core/runtime/index.js b/src/core/runtime/index.js index cb850ef6d..8ba99d37b 100644 --- a/src/core/runtime/index.js +++ b/src/core/runtime/index.js @@ -44,7 +44,7 @@ canIUses.forEach(canIUseApi => { let uni = {} -if (typeof Proxy !== 'undefined') { +if (typeof Proxy !== 'undefined' && __PLATFORM__ !== 'app-plus') { uni = new Proxy({}, { get (target, name) { if (name === 'upx2px') { @@ -98,11 +98,12 @@ if (typeof Proxy !== 'undefined') { } if (__PLATFORM__ === 'app-plus') { - if (typeof global !== 'undefined') { + if (typeof global !== 'undefined') { + global.uni = uni global.UniEmitter = eventApi } } - + __GLOBAL__.createApp = createApp __GLOBAL__.createPage = createPage __GLOBAL__.createComponent = createComponent -- GitLab