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

feat(vue3): render

上级 c1c85721
...@@ -98,6 +98,9 @@ function initBaseInstance(instance, options) { ...@@ -98,6 +98,9 @@ function initBaseInstance(instance, options) {
ctx.mpType = options.mpType; // @deprecated ctx.mpType = options.mpType; // @deprecated
ctx.$mpType = options.mpType; ctx.$mpType = options.mpType;
ctx.$scope = options.mpInstance; ctx.$scope = options.mpInstance;
// TODO @deprecated
ctx.$mp = {};
ctx._self = {};
// $vm // $vm
ctx.$scope.$vm = instance.proxy; ctx.$scope.$vm = instance.proxy;
// slots // slots
......
...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) {
ctx.mpType = options.mpType; // @deprecated ctx.mpType = options.mpType; // @deprecated
ctx.$mpType = options.mpType; ctx.$mpType = options.mpType;
ctx.$scope = options.mpInstance; ctx.$scope = options.mpInstance;
// TODO @deprecated
ctx.$mp = {};
ctx._self = {};
// $vm // $vm
ctx.$scope.$vm = instance.proxy; ctx.$scope.$vm = instance.proxy;
// slots // slots
......
...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) {
ctx.mpType = options.mpType; // @deprecated ctx.mpType = options.mpType; // @deprecated
ctx.$mpType = options.mpType; ctx.$mpType = options.mpType;
ctx.$scope = options.mpInstance; ctx.$scope = options.mpInstance;
// TODO @deprecated
ctx.$mp = {};
ctx._self = {};
// $vm // $vm
ctx.$scope.$vm = instance.proxy; ctx.$scope.$vm = instance.proxy;
// slots // slots
......
...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) {
ctx.mpType = options.mpType; // @deprecated ctx.mpType = options.mpType; // @deprecated
ctx.$mpType = options.mpType; ctx.$mpType = options.mpType;
ctx.$scope = options.mpInstance; ctx.$scope = options.mpInstance;
// TODO @deprecated
ctx.$mp = {};
ctx._self = {};
// $vm // $vm
ctx.$scope.$vm = instance.proxy; ctx.$scope.$vm = instance.proxy;
// slots // slots
......
...@@ -3043,6 +3043,11 @@ function getVueInstanceData(instance) { ...@@ -3043,6 +3043,11 @@ function getVueInstanceData(instance) {
}); });
} }
} }
if (ctx.$mp) {
// TODO
extend(ret, ctx.$mp.data || {});
}
// TODO form-field
// track // track
return { keys, data: JSON.parse(JSON.stringify(ret)) }; return { keys, data: JSON.parse(JSON.stringify(ret)) };
} }
...@@ -3169,9 +3174,11 @@ function setupRenderEffect(instance) { ...@@ -3169,9 +3174,11 @@ function setupRenderEffect(instance) {
// create reactive effect for rendering // create reactive effect for rendering
instance.update = effect(function componentEffect() { instance.update = effect(function componentEffect() {
if (!instance.isMounted) { if (!instance.isMounted) {
instance.render && instance.render.call(instance.proxy);
patch(instance); patch(instance);
} }
else { else {
instance.render && instance.render.call(instance.proxy);
// updateComponent // updateComponent
const { bu, u } = instance; const { bu, u } = instance;
// beforeUpdate hook // beforeUpdate hook
......
...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) {
ctx.mpType = options.mpType; // @deprecated ctx.mpType = options.mpType; // @deprecated
ctx.$mpType = options.mpType; ctx.$mpType = options.mpType;
ctx.$scope = options.mpInstance; ctx.$scope = options.mpInstance;
// TODO @deprecated
ctx.$mp = {};
ctx._self = {};
// $vm // $vm
ctx.$scope.$vm = instance.proxy; ctx.$scope.$vm = instance.proxy;
// slots // slots
......
...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) { ...@@ -91,6 +91,9 @@ function initBaseInstance(instance, options) {
ctx.mpType = options.mpType; // @deprecated ctx.mpType = options.mpType; // @deprecated
ctx.$mpType = options.mpType; ctx.$mpType = options.mpType;
ctx.$scope = options.mpInstance; ctx.$scope = options.mpInstance;
// TODO @deprecated
ctx.$mp = {};
ctx._self = {};
// $vm // $vm
ctx.$scope.$vm = instance.proxy; ctx.$scope.$vm = instance.proxy;
// slots // slots
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册