uniapp和小程序设置tabBar和显示与隐藏tabBar

时间:2025-02-16 09:15:47

(1)设置tabBar:

({});
({});
index number tabBar 的哪一项,从左边算起,索引从0开始
text string tab 上按钮文字
iconPath string 图片路径
selectedIconPath string 选中时的图片路径
pagePath string 页面绝对路径
visible boolean tab 是否显示
({
  index: 0,
  text: 'text',
  iconPath: '/path/to/iconPath',
  selectedIconPath: '/path/to/selectedIconPath',
  pagePath: 'pages/home/home'
})
({
  index: 0,
  text: 'text',
  iconPath: '/path/to/iconPath',
  selectedIconPath: '/path/to/selectedIconPath',
  pagePath: 'pages/home/home'
})

(2)显示tabBar:

();
();

(3)隐藏tabBar:

();
();