diff --git a/packages/uni-mp-alipay/dist/index.js b/packages/uni-mp-alipay/dist/index.js index e943e93a07290c56ba21133a2cd567f34edfc6c8..eaceec18684a0e47b859ec8a4da0723fd94ceeaa 100644 --- a/packages/uni-mp-alipay/dist/index.js +++ b/packages/uni-mp-alipay/dist/index.js @@ -1667,8 +1667,7 @@ const customize = cached((str) => { return camelize(str.replace(customizeRE, '-')) }); -// 钉钉小程序是 component2 模式 -const isComponent2 = my.dd || my.canIUse('component2'); +const isComponent2 = my.canIUse('component2'); const mocks = ['$id']; @@ -2023,8 +2022,14 @@ function parseComponent (vueComponentOptions) { mixins: initBehaviors(vueOptions, initBehavior), data: initData(vueOptions, Vue.prototype), props, - didMount () { - initVm.call(this, VueComponent); + didMount () { + if (my.dd) { // 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法 + setTimeout(() => { + initVm.call(this, VueComponent); + }, 4); + } else { + initVm.call(this, VueComponent); + } initSpecialMethods(this); diff --git a/packages/uni-mp-qq/dist/index.js b/packages/uni-mp-qq/dist/index.js index 550c5722ed4e16844508949ec41b414ee21b033e..50e52986beb6f6da659fbcaed8a40af716df3ba1 100644 --- a/packages/uni-mp-qq/dist/index.js +++ b/packages/uni-mp-qq/dist/index.js @@ -1214,6 +1214,11 @@ function parseBaseApp (vm, { if (this.$vm) { // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前 return } + { + if (!wx.canIUse('nextTick')) { // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断 + console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.0`以上'); + } + } this.$vm = vm; @@ -1339,6 +1344,13 @@ function parseBaseComponent (vueComponentOptions, { addGlobalClass: true }; + { + // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项 + if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) { + Object.assign(options, vueOptions['mp-weixin']['options']); + } + } + const componentOptions = { options, data: initData(vueOptions, Vue.prototype), diff --git a/packages/uni-mp-weixin/dist/index.js b/packages/uni-mp-weixin/dist/index.js index 019d35b675b77f51992de8b878212a3596039f8c..bfe222be78f748dfe6429776a32ce28eb90ab328 100644 --- a/packages/uni-mp-weixin/dist/index.js +++ b/packages/uni-mp-weixin/dist/index.js @@ -1281,7 +1281,7 @@ function parseBaseComponent (vueComponentOptions, { }; { - // 微信multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项 + // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项 if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) { Object.assign(options, vueOptions['mp-weixin']['options']); } diff --git a/src/platforms/mp-alipay/runtime/wrapper/component-parser.js b/src/platforms/mp-alipay/runtime/wrapper/component-parser.js index e589887c494a7544fb951b2174e3eb09695bf625..5d8a9be9754a5e8a69052d06d75a3da8ade5c807 100644 --- a/src/platforms/mp-alipay/runtime/wrapper/component-parser.js +++ b/src/platforms/mp-alipay/runtime/wrapper/component-parser.js @@ -91,8 +91,14 @@ export default function parseComponent (vueComponentOptions) { mixins: initBehaviors(vueOptions, initBehavior), data: initData(vueOptions, Vue.prototype), props, - didMount () { - initVm.call(this, VueComponent) + didMount () { + if (my.dd) { // 钉钉小程序底层基础库有 bug,组件嵌套使用时,在 didMount 中无法及时调用 props 中的方法 + setTimeout(() => { + initVm.call(this, VueComponent) + }, 4) + } else { + initVm.call(this, VueComponent) + } initSpecialMethods(this) diff --git a/src/platforms/mp-alipay/runtime/wrapper/util.js b/src/platforms/mp-alipay/runtime/wrapper/util.js index 0659476397d9c809ae034c7a4fe4b62ed9d41f6f..471b0f7219706823903a90d0581f6b4c48fff204 100644 --- a/src/platforms/mp-alipay/runtime/wrapper/util.js +++ b/src/platforms/mp-alipay/runtime/wrapper/util.js @@ -16,8 +16,7 @@ const customize = cached((str) => { return camelize(str.replace(customizeRE, '-')) }) -// 钉钉小程序是 component2 模式 -export const isComponent2 = my.dd || my.canIUse('component2') +export const isComponent2 = my.canIUse('component2') export const mocks = ['$id'] diff --git a/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js b/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js index 6e16203bf24b90de5b211b85870d589bd8ba11f5..2a05720f1a1dd017d40b82c5c1b40d361adb57a4 100644 --- a/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js +++ b/src/platforms/mp-weixin/runtime/wrapper/app-base-parser.js @@ -52,7 +52,7 @@ export default function parseBaseApp (vm, { if (this.$vm) { // 已经初始化过了,主要是为了百度,百度 onShow 在 onLaunch 之前 return } - if (__PLATFORM__ === 'mp-weixin') { + if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq') { if (!wx.canIUse('nextTick')) { // 事实 上2.2.3 即可,简单使用 2.3.0 的 nextTick 判断 console.error('当前微信基础库版本过低,请将 微信开发者工具-详情-项目设置-调试基础库版本 更换为`2.3.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 23a569e1b490f2ae2d80fce613053b1129a54f04..e560022d5807cd484e4b1428a5b9e37f36a158ba 100644 --- a/src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js +++ b/src/platforms/mp-weixin/runtime/wrapper/component-base-parser.js @@ -26,8 +26,8 @@ export default function parseBaseComponent (vueComponentOptions, { addGlobalClass: true } - if (__PLATFORM__ === 'mp-weixin') { - // 微信multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项 + if (__PLATFORM__ === 'mp-weixin' || __PLATFORM__ === 'mp-qq') { + // 微信 multipleSlots 部分情况有 bug,导致内容顺序错乱 如 u-list,提供覆盖选项 if (vueOptions['mp-weixin'] && vueOptions['mp-weixin']['options']) { Object.assign(options, vueOptions['mp-weixin']['options']) }