@@ -13,6 +13,7 @@ import { useBridge } from '@front/features/bridge'
13
13
import { useInspectors } from ' @front/features/inspector/custom/composable'
14
14
import { useTabs } from ' ./tabs'
15
15
import { showAppsSelector } from ' ./header'
16
+ import { useOrientation } from ' ../layout/orientation'
16
17
17
18
export default defineComponent ({
18
19
components: {
@@ -65,11 +66,16 @@ export default defineComponent({
65
66
immediate: true ,
66
67
})
67
68
69
+ // Orientation
70
+
71
+ const { orientation } = useOrientation ()
72
+
68
73
return {
69
74
inspectorRoutes ,
70
75
currentInspectorRoute ,
71
76
lastInspectorRoute ,
72
77
showAppsSelector ,
78
+ orientation ,
73
79
}
74
80
},
75
81
})
@@ -95,22 +101,50 @@ export default defineComponent({
95
101
<template v-if =" currentInspectorRoute " >
96
102
<img src =" ~@front/assets/breadcrumb-separator.svg" >
97
103
98
- <AppHeaderSelect
99
- :items =" inspectorRoutes"
100
- :selected-item =" currentInspectorRoute"
101
- @select =" route => $router.push(route.targetRoute)"
102
- >
103
- <template #default =" { item } " >
104
- <div class =" flex items-center space-x-2" >
105
- <span class =" flex-1" >{{ item.label }}</span >
106
- <PluginSourceIcon
107
- v-if =" item.pluginId"
108
- :plugin-id =" item.pluginId"
109
- class =" flex-none"
110
- />
111
- </div >
112
- </template >
113
- </AppHeaderSelect >
104
+ <template v-if =" orientation === ' portrait' || inspectorRoutes .length * 200 > $responsive .width - 420 " >
105
+ <AppHeaderSelect
106
+ :items =" inspectorRoutes"
107
+ :selected-item =" currentInspectorRoute"
108
+ @select =" route => $router.push(route.targetRoute)"
109
+ >
110
+ <template #default =" { item } " >
111
+ <div class =" flex items-center space-x-2" >
112
+ <span class =" flex-1" >{{ item.label }}</span >
113
+ <PluginSourceIcon
114
+ v-if =" item.pluginId"
115
+ :plugin-id =" item.pluginId"
116
+ class =" flex-none"
117
+ />
118
+ </div >
119
+ </template >
120
+ </AppHeaderSelect >
121
+ </template >
122
+
123
+ <template v-else >
124
+ <VueGroup
125
+ :value =" currentInspectorRoute"
126
+ class =" primary"
127
+ indicator
128
+ @update =" route => $router.push(route.targetRoute)"
129
+ >
130
+ <VueGroupButton
131
+ v-for =" item of inspectorRoutes"
132
+ :key =" item.id"
133
+ :value =" item"
134
+ :icon-left =" item.icon"
135
+ class =" flat"
136
+ >
137
+ <div class =" flex items-center space-x-2" >
138
+ <span class =" flex-1" >{{ item.label }}</span >
139
+ <PluginSourceIcon
140
+ v-if =" item.pluginId"
141
+ :plugin-id =" item.pluginId"
142
+ class =" flex-none"
143
+ />
144
+ </div >
145
+ </VueGroupButton >
146
+ </VueGroup >
147
+ </template >
114
148
</template >
115
149
116
150
<div class =" flex-1" />
0 commit comments