提交 03de6b76 编写于 作者: D Danny

mp-weixin: Fix Component don't inherit props from Vue.extend(). Support externalClasses option.

Fix inheritance issue by using Vue.options instead of Vue.extendOptions.
Add externalClasses to wechat MP component options.
上级 999bf211
...@@ -20,13 +20,14 @@ export default function parseBaseComponent (vueComponentOptions, { ...@@ -20,13 +20,14 @@ export default function parseBaseComponent (vueComponentOptions, {
initRelation initRelation
} = {}) { } = {}) {
let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions) let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions)
vueOptions = VueComponent.options || vueOptions
const options = { const options = {
multipleSlots: true, multipleSlots: true,
addGlobalClass: true addGlobalClass: true
} }
if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq') { if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq') {
// 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项 // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项
if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) { if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) {
Object.assign(options, vueOptions['mp-weixin']['options']) Object.assign(options, vueOptions['mp-weixin']['options'])
...@@ -96,6 +97,10 @@ export default function parseBaseComponent (vueComponentOptions, { ...@@ -96,6 +97,10 @@ export default function parseBaseComponent (vueComponentOptions, {
__e: handleEvent __e: handleEvent
} }
} }
// externalClasses
if (vueOptions.externalClasses) {
componentOptions.externalClasses = vueOptions.externalClasses
}
if (Array.isArray(vueOptions.wxsCallMethods)) { if (Array.isArray(vueOptions.wxsCallMethods)) {
vueOptions.wxsCallMethods.forEach(callMethod => { vueOptions.wxsCallMethods.forEach(callMethod => {
...@@ -109,4 +114,4 @@ export default function parseBaseComponent (vueComponentOptions, { ...@@ -109,4 +114,4 @@ export default function parseBaseComponent (vueComponentOptions, {
return componentOptions return componentOptions
} }
return [componentOptions, VueComponent] return [componentOptions, VueComponent]
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册