From 76307a8a4155fcaeda57d83cf00bf13ec889e55b Mon Sep 17 00:00:00 2001 From: xujiujiu <906784584@qq.com> Date: Thu, 13 Jul 2023 15:35:46 +0800 Subject: [PATCH 1/4] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3taro=20vue2?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E4=B8=AD=E5=9C=A8app=20=E7=9A=84beforeCreate?= =?UTF-8?q?=20=E4=B8=AD=E8=AE=BE=E7=BD=AE=E7=9A=84Vue.config.ignoredElemen?= =?UTF-8?q?ts=20=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/component-lib/index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/taro-components-library-vue2/src/component-lib/index.ts b/packages/taro-components-library-vue2/src/component-lib/index.ts index 6b357a2cc8f..02eaac95a62 100644 --- a/packages/taro-components-library-vue2/src/component-lib/index.ts +++ b/packages/taro-components-library-vue2/src/component-lib/index.ts @@ -22,8 +22,7 @@ components.forEach(params => { } }) -Vue.config.ignoredElements = [ - 'root', - 'block', - /^taro-/ -] +const ignoredElements = [/^taro-/, 'root', 'block'] +if (!Vue.config.ignoredElements?.includes(ignoredElements[0])) { + Vue.config.ignoredElements = [...Vue.config.ignoredElements, ...ignoredElements] +} From a8194005605fdb05558676bd62b9eac325c4be90 Mon Sep 17 00:00:00 2001 From: xujiujiu <906784584@qq.com> Date: Thu, 13 Jul 2023 15:35:56 +0800 Subject: [PATCH 2/4] =?UTF-8?q?fix:=20=E8=A7=A3=E5=86=B3taro=20vue2?= =?UTF-8?q?=E5=B7=A5=E7=A8=8B=E4=B8=AD=E5=9C=A8app=20=E7=9A=84beforeCreate?= =?UTF-8?q?=20=E4=B8=AD=E8=AE=BE=E7=BD=AE=E7=9A=84Vue.config.ignoredElemen?= =?UTF-8?q?ts=20=E4=B8=8D=E7=94=9F=E6=95=88=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From 79eeac8fe5608d07dde90e6c903f6484a95b9bb3 Mon Sep 17 00:00:00 2001 From: xujiujiu <906784584@qq.com> Date: Fri, 14 Jul 2023 14:56:35 +0800 Subject: [PATCH 3/4] =?UTF-8?q?fix:=20=E5=8E=BB=E9=99=A4=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E7=9A=84ignoredElements=20=E8=A6=86=E7=9B=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taro-components-library-vue2/src/component-lib/index.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/taro-components-library-vue2/src/component-lib/index.ts b/packages/taro-components-library-vue2/src/component-lib/index.ts index 02eaac95a62..073c21d6b97 100644 --- a/packages/taro-components-library-vue2/src/component-lib/index.ts +++ b/packages/taro-components-library-vue2/src/component-lib/index.ts @@ -21,8 +21,3 @@ components.forEach(params => { } } }) - -const ignoredElements = [/^taro-/, 'root', 'block'] -if (!Vue.config.ignoredElements?.includes(ignoredElements[0])) { - Vue.config.ignoredElements = [...Vue.config.ignoredElements, ...ignoredElements] -} From 5fda1f469680d8efba80c44e901cfc32951eae88 Mon Sep 17 00:00:00 2001 From: xujiujiu <906784584@qq.com> Date: Tue, 30 Jul 2024 14:56:25 +0800 Subject: [PATCH 4/4] =?UTF-8?q?feat:=20[taro-mini-runner]=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E5=B0=8F=E7=A8=8B=E5=BA=8Ftabbar=20list=20=E4=B8=AD?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E7=B1=BB=E5=9E=8B=E4=B8=8D=E5=8C=B9=E9=85=8D?= =?UTF-8?q?=E6=97=B6=E7=BC=96=E8=AF=91=E6=97=B6=E9=9C=80=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E6=8F=90=E9=86=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../taro-webpack5-runner/src/plugins/MiniPlugin.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/taro-webpack5-runner/src/plugins/MiniPlugin.ts b/packages/taro-webpack5-runner/src/plugins/MiniPlugin.ts index c2d38b89dc0..32f912dea62 100644 --- a/packages/taro-webpack5-runner/src/plugins/MiniPlugin.ts +++ b/packages/taro-webpack5-runner/src/plugins/MiniPlugin.ts @@ -1048,7 +1048,16 @@ export default class TaroMiniPlugin { if (tabBar && typeof tabBar === 'object' && !isEmptyObject(tabBar)) { // eslint-disable-next-line dot-notation const list = tabBar['list'] || [] - list.forEach(item => { + list.forEach((item, index) => { + if (Object.prototype.toString.call(item) !== '[object Object]') { + throw new Error(`[ app.json 文件内容错误] app.json: tabBar.list[${index}] 字段需为 object`) + } + if (!Object.prototype.hasOwnProperty.call(item, 'pagePath') || item.pagePath === '') { + throw new Error(`[ app.json 文件内容错误] app.json: tabBar.list[${index}].pagePath 不能为空`) + } + if (typeof item.pagePath !== 'string') { + throw new Error(`[ app.json 文件内容错误] app.json: tabBar.list[${index}].pagePath 需为 string`) + } // eslint-disable-next-line dot-notation item['iconPath'] && this.tabBarIcons.add(item['iconPath']) // eslint-disable-next-line dot-notation