Skip to content

Commit ae88db1

Browse files
Update DesignToolbars.vue
1 parent a4653fd commit ae88db1

1 file changed

Lines changed: 48 additions & 2 deletions

File tree

packages/layout/src/DesignToolbars.vue

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
<template>
22
<div class="tiny-engine-toolbar">
33
<div class="toolbar-left">
4+
<tiny-popover :visible-arrow="false" trigger="hover" placement="bottom-start" popper-class="center-popover">
5+
<template #reference>
6+
<div class="app-center-icon">
7+
<svg-icon name="small-list"></svg-icon>
8+
</div>
9+
</template>
10+
<div class="app-center-item">
11+
<span @click="gotoCenter('app')">应用中心</span>
12+
<span @click="gotoCenter('template')">模板中心</span>
13+
</div>
14+
</tiny-popover>
415
<component
516
:is="getMergeMeta(comp)?.entry"
617
v-for="comp in toolbars.left"
@@ -49,12 +60,14 @@
4960
<script lang="ts">
5061
/* metaService: engine.layout.DesignToolbars */
5162
import { computed } from 'vue'
63+
import { Popover } from '@opentiny/vue'
5264
import { getMergeMeta, useLayout } from '@opentiny/tiny-engine-meta-register'
5365
import ToolbarCollapse from './ToolbarCollapse.vue'
5466
5567
export default {
5668
components: {
57-
ToolbarCollapse
69+
ToolbarCollapse,
70+
TinyPopover: Popover
5871
},
5972
props: {
6073
layoutRegistry: {
@@ -71,9 +84,14 @@ export default {
7184
return layoutConfig.toolbars
7285
})
7386
87+
const gotoCenter = (type: string) => {
88+
window.open(`/template.html?type=${type}`, '_blank')
89+
}
90+
7491
return {
7592
getMergeMeta,
76-
toolbars
93+
toolbars,
94+
gotoCenter
7795
}
7896
}
7997
}
@@ -135,6 +153,22 @@ export default {
135153
background: var(--te-layout-common-icon-bg-color-hover);
136154
}
137155
}
156+
.app-center-icon {
157+
background: var(--te-layout-common-active-bg);
158+
display: inline-flex;
159+
justify-content: center;
160+
align-items: center;
161+
vertical-align: middle;
162+
width: 26px;
163+
height: 26px;
164+
border-radius: 4px;
165+
position: relative;
166+
margin-left: 4px;
167+
168+
.svg-icon {
169+
font-size: 16px;
170+
}
171+
}
138172
}
139173
140174
.toolbar-right {
@@ -198,6 +232,18 @@ export default {
198232
display: none;
199233
}
200234
}
235+
.center-popover {
236+
.app-center-item {
237+
display: flex;
238+
justify-content: center;
239+
flex-direction: column;
240+
gap: 8px;
241+
242+
span {
243+
cursor: pointer;
244+
}
245+
}
246+
}
201247
202248
@media only screen and (max-width: 1280px) {
203249
.tiny-engine-toolbar {

0 commit comments

Comments
 (0)