From 323e28eb57ccb4becff589e4e21717ef59ced15d Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Wed, 6 Nov 2019 17:28:13 +0800 Subject: [PATCH] feat(mp-weixin): add options --- .../runtime/wrapper/component-base-parser.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) 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 34cea7acb..ff9e97c60 100644 --- a/src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js +++ b/src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js @@ -21,11 +21,20 @@ export default function parseBaseComponent (vueComponentOptions, { } = {}) { let [VueComponent, vueOptions] = initVueComponent(Vue, vueComponentOptions) + const options = { + multipleSlots: true, + addGlobalClass: true + } + + if (__PLATFORM__ === 'mp-weixin') { + // 微信multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项 + if (vueComponentOptions['mp-weixin'] && vueComponentOptions['mp-weixin']['options']) { + Object.assign(options, vueComponentOptions['mp-weixin']['options']) + } + } + const componentOptions = { - options: { - multipleSlots: true, - addGlobalClass: true - }, + options, data: initData(vueOptions, Vue.prototype), behaviors: initBehaviors(vueOptions, initBehavior), properties: initProperties(vueOptions.props, false, vueOptions.__file), -- GitLab