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

build uni mp-alipay

上级 0249de45
......@@ -1283,6 +1283,25 @@ function initRelation$1 (detail) {
this.props.onVueInit(detail);
}
const SPECIAL_EVENTS = [
'formReset',
'markerTap',
'calloutTap',
'controlTap',
'regionChange'
];
function initSpecialEvents (mpMethods, vueMethods) {
if (!vueMethods) {
return
}
SPECIAL_EVENTS.forEach((name) => {
if (vueMethods[name]) {
mpMethods[name] = vueMethods[name];
}
});
}
function initChildVues (mpInstance) {
// 此时需保证当前 mpInstance 已经存在 $vm
if (!mpInstance.$vm) {
......@@ -1478,9 +1497,7 @@ function parsePage (vuePageOptions) {
initHooks(pageOptions, hooks$1);
if (vueOptions.methods && vueOptions.methods.formReset) {
pageOptions.formReset = vueOptions.methods.formReset;
}
initSpecialEvents(pageOptions, vueOptions.methods);
return pageOptions
}
......@@ -1589,15 +1606,14 @@ function parseComponent (vueComponentOptions) {
componentOptions.didUpdate = createObserver$1(true);
}
if (vueOptions.methods && vueOptions.methods.formReset) {
componentOptions.methods.formReset = vueOptions.methods.formReset;
}
initSpecialEvents(componentOptions.methods, vueOptions.methods);
return componentOptions
}
function createComponent (vueOptions) {
{
return my.createComponent(parseComponent(vueOptions))
return my.defineComponent(parseComponent(vueOptions))
}
}
......
{
"name": "@dcloudio/uni-mp-alipay",
"version": "0.0.806",
"version": "0.0.807",
"description": "uni-app mp-alipay",
"main": "dist/index.js",
"scripts": {
......
......@@ -2,7 +2,7 @@ import parseComponent from 'uni-platform/runtime/wrapper/component-parser'
export default function createComponent (vueOptions) {
if (__PLATFORM__ === 'mp-alipay') {
return my.createComponent(parseComponent(vueOptions))
return my.defineComponent(parseComponent(vueOptions))
} else {
return Component(parseComponent(vueOptions))
}
......
......@@ -70,7 +70,7 @@ export default function parsePage (vuePageOptions) {
initHooks(pageOptions, hooks)
initSpecialEvents(pageOptions.methods, vueOptions.methods)
initSpecialEvents(pageOptions, vueOptions.methods)
return pageOptions
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册