|
|
@@ -15,12 +15,25 @@
|
|
|
// Props
|
|
|
type Props = {
|
|
|
current?: number
|
|
|
+ hide0:number
|
|
|
+ hide1:number
|
|
|
+ hide2:number
|
|
|
+ hide3:number
|
|
|
}
|
|
|
|
|
|
const props = withDefaults(defineProps<Props>(), {
|
|
|
- current: 0
|
|
|
+ current: 0,
|
|
|
+ hide0:1,
|
|
|
+ hide1:1,
|
|
|
+ hide2:1,
|
|
|
+ hide3:1
|
|
|
})
|
|
|
|
|
|
+ const hide0 = ref<number>(props.hide0)
|
|
|
+ const hide1 = ref<number>(props.hide1)
|
|
|
+ const hide2 = ref<number>(props.hide2)
|
|
|
+ const hide3 = ref<number>(props.hide3)
|
|
|
+
|
|
|
// Tab 列表配置
|
|
|
type TabItem = {
|
|
|
pagePath: string
|
|
|
@@ -28,8 +41,8 @@
|
|
|
iconPath: string
|
|
|
selectedIconPath: string
|
|
|
}
|
|
|
-
|
|
|
- const tabList: TabItem[] = [
|
|
|
+ const tabList: TabItem[] = [];
|
|
|
+ const tabList1: TabItem[] = [
|
|
|
{
|
|
|
pagePath: '/pages/index/index',
|
|
|
text: '首页',
|
|
|
@@ -55,7 +68,15 @@
|
|
|
selectedIconPath: '/static/images/custom-tabbar/66.png'
|
|
|
}
|
|
|
]
|
|
|
-
|
|
|
+
|
|
|
+ const hideValues = [props.hide0, props.hide1, props.hide2, props.hide3]
|
|
|
+ for (let i = 0; i < tabList1.length; i++) {
|
|
|
+ if (i < hideValues.length && hideValues[i] === 1) {
|
|
|
+ // hide 值为 1 时显示,添加到 tabList
|
|
|
+ tabList.push(tabList1[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// 当前选中索引
|
|
|
const currentIndex = ref<number>(props.current)
|
|
|
|