diff --git a/.eslintignore b/.eslintignore index 4ac17f850800d166e0357a4d0c46c6810809ca71..69aec5f6427caad89fabcf995715862b7403024b 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,2 +1,3 @@ src/core/helpers/html-parser.js +src/platforms/app-plus-nvue/runtime build/rollup-plugin-require-context diff --git a/packages/uni-app-plus/dist/index.js b/packages/uni-app-plus/dist/index.js index 58500876f35d87942b5cc1f805df4ff672c93c28..b5c9f32b8507521ac430cd663f50c3bb648373f1 100644 --- a/packages/uni-app-plus/dist/index.js +++ b/packages/uni-app-plus/dist/index.js @@ -1434,6 +1434,9 @@ let uni = {}; if (typeof Proxy !== 'undefined' && "app-plus" !== 'app-plus') { uni = new Proxy({}, { get (target, name) { + if (target[name]) { + return target[name] + } if (baseApi[name]) { return baseApi[name] } @@ -1447,9 +1450,12 @@ if (typeof Proxy !== 'undefined' && "app-plus" !== 'app-plus') { return } return promisify(name, wrapper(name, wx[name])) + }, + set (target, name, value) { + target[name] = value; } }); -} else { +} else { Object.keys(baseApi).forEach(name => { uni[name] = baseApi[name]; }); diff --git a/packages/uni-app-plus/package.json b/packages/uni-app-plus/package.json index ffa3c1a85a78fa5ffa5f2e4233c66ebdeb6874ea..e936762667bc6d19bc7b9dfd40f2b20f9eb870e7 100644 --- a/packages/uni-app-plus/package.json +++ b/packages/uni-app-plus/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-app-plus", - "version": "0.0.249", + "version": "0.0.250", "description": "uni-app app-plus", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index 655d85fd348e774d3810938af05f42ba4e6fa910..8e5c2867544b415429a81c5c0f581254797c9463 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -2009,6 +2009,9 @@ let uni = {}; if (typeof Proxy !== 'undefined' && "mp-alipay" !== 'app-plus') { uni = new Proxy({}, { get (target, name) { + if (target[name]) { + return target[name] + } if (baseApi[name]) { return baseApi[name] } @@ -2030,9 +2033,12 @@ if (typeof Proxy !== 'undefined' && "mp-alipay" !== 'app-plus') { return } return promisify(name, wrapper(name, my[name])) + }, + set (target, name, value) { + target[name] = value; } }); -} else { +} else { Object.keys(baseApi).forEach(name => { uni[name] = baseApi[name]; }); diff --git a/packages/uni-mp-alipay/package.json b/packages/uni-mp-alipay/package.json index 9d0d4b8139beac0e0c31189d046905e5aa147c49..d964ac1a1f48d2bffbbb6c26d560e0878eeec581 100644 --- a/packages/uni-mp-alipay/package.json +++ b/packages/uni-mp-alipay/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-alipay", - "version": "0.0.823", + "version": "0.0.824", "description": "uni-app mp-alipay", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-baidu/dist/index.js b/packages/uni-mp-baidu/dist/index.js index 4c46829069ba325d6a7e9f570f602767972a71f6..f0f11e7425e1eab69d421ace464fb89256d83fe5 100644 --- a/packages/uni-mp-baidu/dist/index.js +++ b/packages/uni-mp-baidu/dist/index.js @@ -1592,6 +1592,9 @@ let uni = {}; if (typeof Proxy !== 'undefined' && "mp-baidu" !== 'app-plus') { uni = new Proxy({}, { get (target, name) { + if (target[name]) { + return target[name] + } if (baseApi[name]) { return baseApi[name] } @@ -1613,9 +1616,12 @@ if (typeof Proxy !== 'undefined' && "mp-baidu" !== 'app-plus') { return } return promisify(name, wrapper(name, swan[name])) + }, + set (target, name, value) { + target[name] = value; } }); -} else { +} else { Object.keys(baseApi).forEach(name => { uni[name] = baseApi[name]; }); diff --git a/packages/uni-mp-baidu/package.json b/packages/uni-mp-baidu/package.json index a083e489d9ce7e941431e64dbbcbef405fa7234d..bfd305847bbce49741e23cbb2ef81de8ff3662e4 100644 --- a/packages/uni-mp-baidu/package.json +++ b/packages/uni-mp-baidu/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-baidu", - "version": "0.0.853", + "version": "0.0.854", "description": "uni-app mp-baidu", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index ec95ae0a6948ef85f5c915280d7b62c6caae3524..63a22e2df000f8fc3b124e4b6e37de250e4665ec 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -1473,6 +1473,9 @@ let uni = {}; if (typeof Proxy !== 'undefined' && "mp-qq" !== 'app-plus') { uni = new Proxy({}, { get (target, name) { + if (target[name]) { + return target[name] + } if (baseApi[name]) { return baseApi[name] } @@ -1494,9 +1497,12 @@ if (typeof Proxy !== 'undefined' && "mp-qq" !== 'app-plus') { return } return promisify(name, wrapper(name, wx[name])) + }, + set (target, name, value) { + target[name] = value; } }); -} else { +} else { Object.keys(baseApi).forEach(name => { uni[name] = baseApi[name]; }); diff --git a/packages/uni-mp-qq/package.json b/packages/uni-mp-qq/package.json index 5079bfb3620a6b7681c25e7fa5a1ac3f153d5511..d19816f05b63dafe0dd15367336ccac5b4352207 100644 --- a/packages/uni-mp-qq/package.json +++ b/packages/uni-mp-qq/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-qq", - "version": "0.0.107", + "version": "0.0.108", "description": "uni-app mp-qq", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-toutiao/dist/index.js b/packages/uni-mp-toutiao/dist/index.js index 1a0b2712a756a42bb734d89baec88e982ccb6a36..425f7a006f559bdae6c853b7a5dadd7481f351ea 100644 --- a/packages/uni-mp-toutiao/dist/index.js +++ b/packages/uni-mp-toutiao/dist/index.js @@ -1652,6 +1652,9 @@ let uni = {}; if (typeof Proxy !== 'undefined' && "mp-toutiao" !== 'app-plus') { uni = new Proxy({}, { get (target, name) { + if (target[name]) { + return target[name] + } if (baseApi[name]) { return baseApi[name] } @@ -1673,9 +1676,12 @@ if (typeof Proxy !== 'undefined' && "mp-toutiao" !== 'app-plus') { return } return promisify(name, wrapper(name, tt[name])) + }, + set (target, name, value) { + target[name] = value; } }); -} else { +} else { Object.keys(baseApi).forEach(name => { uni[name] = baseApi[name]; }); diff --git a/packages/uni-mp-toutiao/package.json b/packages/uni-mp-toutiao/package.json index 704f47621297e4f7229ad0d1ff70c3eaf0642048..793f9afe746453afecf16eac449f67104daa9a1b 100644 --- a/packages/uni-mp-toutiao/package.json +++ b/packages/uni-mp-toutiao/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-toutiao", - "version": "0.0.347", + "version": "0.0.348", "description": "uni-app mp-toutiao", "main": "dist/index.js", "scripts": { diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index bbbe2d6b0378cb3eb55085ea2783d0ef7c79fda5..fc59732eb5357a8078efd6569f60a80f7dc0a638 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -1404,6 +1404,9 @@ let uni = {}; if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') { uni = new Proxy({}, { get (target, name) { + if (target[name]) { + return target[name] + } if (baseApi[name]) { return baseApi[name] } @@ -1425,9 +1428,12 @@ if (typeof Proxy !== 'undefined' && "mp-weixin" !== 'app-plus') { return } return promisify(name, wrapper(name, wx[name])) + }, + set (target, name, value) { + target[name] = value; } }); -} else { +} else { Object.keys(baseApi).forEach(name => { uni[name] = baseApi[name]; }); diff --git a/packages/uni-mp-weixin/package.json b/packages/uni-mp-weixin/package.json index 41934167c26fe29e3b1daf446d73a3fef4cff601..79a7153cb44c39fc98619522d9e92f974dc57289 100644 --- a/packages/uni-mp-weixin/package.json +++ b/packages/uni-mp-weixin/package.json @@ -1,6 +1,6 @@ { "name": "@dcloudio/uni-mp-weixin", - "version": "0.0.969", + "version": "0.0.970", "description": "uni-app mp-weixin", "main": "dist/index.js", "scripts": { diff --git a/src/core/runtime/index.js b/src/core/runtime/index.js index fbe2295871852a4cfa8ab6726e255ab3d8564754..0904c180ed3d519ca59c60110a40c955e5cd17a7 100644 --- a/src/core/runtime/index.js +++ b/src/core/runtime/index.js @@ -45,6 +45,9 @@ let uni = {} if (typeof Proxy !== 'undefined' && __PLATFORM__ !== 'app-plus') { uni = new Proxy({}, { get (target, name) { + if (target[name]) { + return target[name] + } if (baseApi[name]) { return baseApi[name] } @@ -66,9 +69,12 @@ if (typeof Proxy !== 'undefined' && __PLATFORM__ !== 'app-plus') { return } return promisify(name, wrapper(name, __GLOBAL__[name])) + }, + set (target, name, value) { + target[name] = value } }) -} else { +} else { Object.keys(baseApi).forEach(name => { uni[name] = baseApi[name] }) diff --git a/src/platforms/app-plus-nvue/services/api/legacy/index.js b/src/platforms/app-plus-nvue/services/api/legacy/index.js index 9bae2c68b31ea17b76b91a1cd293d4d8416c270a..09a7ae67c1de7fcd09ca1f78d2e6a886bf707653 100644 --- a/src/platforms/app-plus-nvue/services/api/legacy/index.js +++ b/src/platforms/app-plus-nvue/services/api/legacy/index.js @@ -7,7 +7,7 @@ import { } from 'uni-core/helpers/promise' import { - initSubNVue, + initSubNVue, initPostMessage } from '../sub-nvue' @@ -32,6 +32,9 @@ export default function initUni (uni, nvue, plus, BroadcastChannel) { if (typeof Proxy !== 'undefined') { return new Proxy({}, { get (target, name) { + if (target[name]) { + return target[name] + } if (apis[name]) { return apis[name] } @@ -42,6 +45,9 @@ export default function initUni (uni, nvue, plus, BroadcastChannel) { return } return promisify(name, uni[name]) + }, + set (target, name, value) { + target[name] = value } }) }