forked from opentiny/tiny-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPluginPanel.vue
More file actions
102 lines (94 loc) · 2.28 KB
/
Copy pathPluginPanel.vue
File metadata and controls
102 lines (94 loc) · 2.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<template>
<div class="plugin-panel">
<div class="plugin-panel-header">
<div class="plugin-panel-title">
<span class="title">{{ title }}</span>
<close-icon v-if="isCloseLeft" :name="name" @close="closePanel"></close-icon>
</div>
<div class="plugin-panel-icon">
<slot name="header"></slot>
<close-icon v-if="!isCloseLeft" :name="name" @close="closePanel"></close-icon>
</div>
</div>
<slot name="content"></slot>
</div>
</template>
<script>
import { useLayout } from '@opentiny/tiny-engine-controller'
import CloseIcon from './CloseIcon.vue'
export default {
components: {
CloseIcon
},
props: {
/**
* plugin面板标题
*/
title: {
type: String,
default: ''
},
/**
* 关闭图标是否在左侧
*/
isCloseLeft: {
type: Boolean,
default: false
},
name: {
type: String,
default: 'cross'
}
},
emits: ['close'],
setup(props, { emit }) {
const closePanel = () => {
useLayout().closePlugin()
emit('close')
}
return {
closePanel
}
}
}
</script>
<style lang="less" scoped>
.plugin-panel {
width: 100%;
height: 100%;
background: var(--ti-lowcode-plugin-panel-bg, --ti-lowcode-toolbar-bg);
display: flex;
flex-direction: column;
position: relative;
.plugin-panel-header {
display: flex;
justify-content: space-between;
align-items: center;
line-height: 48px;
font-size: 14px;
font-weight: var(--ti-lowcode-plugin-panel-title-font-weight);
font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
'Helvetica Neue', sans-serif;
padding: 0 12px;
color: var(--ti-lowcode-plugin-panel-title-color);
font-weight: var(--ti-lowcode-plugin-panel-title-font-weight);
border-bottom: 1px solid var(--ti-lowcode-plugin-panel-header-border-bottom-color);
margin-bottom: 16px;
.plugin-panel-title {
display: flex;
align-items: center;
.title + .icon-wrap {
margin-left: 10px;
}
}
.plugin-panel-icon {
display: grid;
grid-auto-flow: column;
align-items: center;
:deep(.svg-button + .svg-button) {
margin: 0;
}
}
}
}
</style>