Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion packages/taro-webpack5-runner/src/plugins/MiniPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down