From 47ebabe731682f9208bcab7690518b25a506a692 Mon Sep 17 00:00:00 2001 From: Danny Date: Sat, 21 Mar 2020 16:25:36 +0800 Subject: [PATCH] use options instead of extendOptions in core runtime. --- src/core/runtime/wrapper/util.js | 28 +++++++++---------- .../runtime/wrapper/component-base-parser.js | 1 - 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/src/core/runtime/wrapper/util.js b/src/core/runtime/wrapper/util.js index ad0d83dec..42f56239f 100644 --- a/src/core/runtime/wrapper/util.js +++ b/src/core/runtime/wrapper/util.js @@ -72,10 +72,10 @@ export function initVueComponent (Vue, vueOptions) { let VueComponent if (isFn(vueOptions)) { VueComponent = vueOptions - vueOptions = VueComponent.extendOptions } else { VueComponent = Vue.extend(vueOptions) } + vueOptions = VueComponent.options return [VueComponent, vueOptions] } @@ -485,18 +485,18 @@ export function handleEvent (event) { handlerCtx.$parent.$parent ) { // mp-weixin,mp-toutiao 抽象节点模拟 scoped slots handlerCtx = handlerCtx.$parent.$parent - } - if (methodName === '$emit') { - handlerCtx.$emit.apply(handlerCtx, - processEventArgs( - this.$vm, - event, - eventArray[1], - eventArray[2], - isCustom, - methodName - )) - return + } + if (methodName === '$emit') { + handlerCtx.$emit.apply(handlerCtx, + processEventArgs( + this.$vm, + event, + eventArray[1], + eventArray[2], + isCustom, + methodName + )) + return } const handler = handlerCtx[methodName] if (!isFn(handler)) { @@ -528,4 +528,4 @@ export function handleEvent (event) { ) { return ret[0] } -} +} diff --git a/src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js b/src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js index 4eb84191a..c032c15b3 100644 --- a/src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js +++ b/src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js @@ -20,7 +20,6 @@ export default function parseBaseComponent (vueComponentOptions, { initRelation } = {}) { let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions) - vueOptions = VueComponent.options || vueOptions const options = { multipleSlots: true, -- GitLab