From 7698e6f4c3bf62774d28c00c8f4ee774ba86a6b7 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Wed, 29 Jul 2020 11:00:27 +0800 Subject: [PATCH] feat(vue3): render --- packages/uni-mp-alipay/dist/uni.mp.esm.js | 3 +++ packages/uni-mp-baidu/dist/uni.mp.esm.js | 3 +++ packages/uni-mp-qq/dist/uni.mp.esm.js | 3 +++ packages/uni-mp-toutiao/dist/uni.mp.esm.js | 3 +++ packages/uni-mp-vue/dist/vue.runtime.esm.js | 7 +++++++ packages/uni-mp-weixin/dist/uni.mp.esm.js | 3 +++ packages/uni-quickapp-webview/dist/uni.mp.esm.js | 3 +++ 7 files changed, 25 insertions(+) diff --git a/packages/uni-mp-alipay/dist/uni.mp.esm.js b/packages/uni-mp-alipay/dist/uni.mp.esm.js index 20decee525..ecf3041e4c 100644 --- a/packages/uni-mp-alipay/dist/uni.mp.esm.js +++ b/packages/uni-mp-alipay/dist/uni.mp.esm.js @@ -98,6 +98,9 @@ function initBaseInstance(instance, options) { ctx.mpType = options.mpType; // @deprecated ctx.$mpType = options.mpType; ctx.$scope = options.mpInstance; + // TODO @deprecated + ctx.$mp = {}; + ctx._self = {}; // $vm ctx.$scope.$vm = instance.proxy; // slots diff --git a/packages/uni-mp-baidu/dist/uni.mp.esm.js b/packages/uni-mp-baidu/dist/uni.mp.esm.js index ebbd35eb3a..d7b14cb0cd 100644 --- a/packages/uni-mp-baidu/dist/uni.mp.esm.js +++ b/packages/uni-mp-baidu/dist/uni.mp.esm.js @@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ctx.mpType = options.mpType; // @deprecated ctx.$mpType = options.mpType; ctx.$scope = options.mpInstance; + // TODO @deprecated + ctx.$mp = {}; + ctx._self = {}; // $vm ctx.$scope.$vm = instance.proxy; // slots diff --git a/packages/uni-mp-qq/dist/uni.mp.esm.js b/packages/uni-mp-qq/dist/uni.mp.esm.js index 65e94e6748..d238158782 100644 --- a/packages/uni-mp-qq/dist/uni.mp.esm.js +++ b/packages/uni-mp-qq/dist/uni.mp.esm.js @@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ctx.mpType = options.mpType; // @deprecated ctx.$mpType = options.mpType; ctx.$scope = options.mpInstance; + // TODO @deprecated + ctx.$mp = {}; + ctx._self = {}; // $vm ctx.$scope.$vm = instance.proxy; // slots diff --git a/packages/uni-mp-toutiao/dist/uni.mp.esm.js b/packages/uni-mp-toutiao/dist/uni.mp.esm.js index 4d025eb9e7..1fe01d7f0d 100644 --- a/packages/uni-mp-toutiao/dist/uni.mp.esm.js +++ b/packages/uni-mp-toutiao/dist/uni.mp.esm.js @@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ctx.mpType = options.mpType; // @deprecated ctx.$mpType = options.mpType; ctx.$scope = options.mpInstance; + // TODO @deprecated + ctx.$mp = {}; + ctx._self = {}; // $vm ctx.$scope.$vm = instance.proxy; // slots diff --git a/packages/uni-mp-vue/dist/vue.runtime.esm.js b/packages/uni-mp-vue/dist/vue.runtime.esm.js index a08d0f1de6..f5735ef548 100644 --- a/packages/uni-mp-vue/dist/vue.runtime.esm.js +++ b/packages/uni-mp-vue/dist/vue.runtime.esm.js @@ -3043,6 +3043,11 @@ function getVueInstanceData(instance) { }); } } + if (ctx.$mp) { + // TODO + extend(ret, ctx.$mp.data || {}); + } + // TODO form-field // track return { keys, data: JSON.parse(JSON.stringify(ret)) }; } @@ -3169,9 +3174,11 @@ function setupRenderEffect(instance) { // create reactive effect for rendering instance.update = effect(function componentEffect() { if (!instance.isMounted) { + instance.render && instance.render.call(instance.proxy); patch(instance); } else { + instance.render && instance.render.call(instance.proxy); // updateComponent const { bu, u } = instance; // beforeUpdate hook diff --git a/packages/uni-mp-weixin/dist/uni.mp.esm.js b/packages/uni-mp-weixin/dist/uni.mp.esm.js index 65e94e6748..d238158782 100644 --- a/packages/uni-mp-weixin/dist/uni.mp.esm.js +++ b/packages/uni-mp-weixin/dist/uni.mp.esm.js @@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ctx.mpType = options.mpType; // @deprecated ctx.$mpType = options.mpType; ctx.$scope = options.mpInstance; + // TODO @deprecated + ctx.$mp = {}; + ctx._self = {}; // $vm ctx.$scope.$vm = instance.proxy; // slots diff --git a/packages/uni-quickapp-webview/dist/uni.mp.esm.js b/packages/uni-quickapp-webview/dist/uni.mp.esm.js index 2d68c7c6cb..e2d498c25d 100644 --- a/packages/uni-quickapp-webview/dist/uni.mp.esm.js +++ b/packages/uni-quickapp-webview/dist/uni.mp.esm.js @@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ctx.mpType = options.mpType; // @deprecated ctx.$mpType = options.mpType; ctx.$scope = options.mpInstance; + // TODO @deprecated + ctx.$mp = {}; + ctx._self = {}; // $vm ctx.$scope.$vm = instance.proxy; // slots -- GitLab