Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
有来技术
vue3-element-admin
提交
529e85ad
V
vue3-element-admin
项目概览
有来技术
/
vue3-element-admin
通知
3
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
V
vue3-element-admin
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
529e85ad
编写于
1月 21, 2023
作者:
H
haoxr
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: 样式优化
上级
a7bf1bd4
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
49 deletion
+27
-49
src/components/RightPanel/index.vue
src/components/RightPanel/index.vue
+27
-49
未找到文件。
src/components/RightPanel/index.vue
浏览文件 @
529e85ad
...
...
@@ -3,10 +3,6 @@ import { onBeforeUnmount, onMounted, ref, watch } from 'vue';
import
{
addClass
,
removeClass
}
from
'
@/utils/index
'
;
// 图标依赖
import
{
Close
,
Setting
}
from
'
@element-plus/icons-vue
'
;
import
{
ElColorPicker
}
from
'
element-plus
'
;
const
show
=
ref
(
false
);
defineProps
({
...
...
@@ -33,24 +29,18 @@ function addEventClick() {
function
closeSidebar
(
evt
:
any
)
{
// 主题选择点击不关闭
let
parent
=
evt
.
target
.
closest
(
'
.theme-picker-dropdown
'
);
if
(
parent
)
{
return
;
}
parent
=
evt
.
target
.
closest
(
'
.right-panel
'
);
let
parent
=
evt
.
target
.
closest
(
'
.right-panel-container
'
);
if
(
!
parent
)
{
show
.
value
=
false
;
window
.
removeEventListener
(
'
click
'
,
closeSidebar
);
}
}
const
rightPanel
=
ref
(
ElColorPicker
);
const
rightPanel
=
ref
();
function
insertToBody
()
{
const
elx
=
rightPanel
.
value
as
any
;
const
body
=
document
.
querySelector
(
'
body
'
)
as
any
;
body
.
insertBefore
(
elx
,
body
.
firstChild
);
body
.
insertBefore
(
rightPanel
.
value
,
body
.
firstChild
);
}
onMounted
(()
=>
{
...
...
@@ -58,53 +48,46 @@ onMounted(() => {
});
onBeforeUnmount
(()
=>
{
const
elx
=
rightPanel
.
value
as
any
;
elx
.
remove
();
rightPanel
.
value
.
remove
();
});
</
script
>
<
template
>
<div
ref=
"rightPanel"
:class=
"
{ show: show }
">
<div
class=
"right-panel-
background
"
/>
<div
class=
"right-panel"
>
<div
:class=
"
{ show: show }" ref="rightPanel
">
<div
class=
"right-panel-
overlay
"
/>
<div
class=
"right-panel
-container
"
>
<div
class=
"right-panel
__butto
n"
class=
"right-panel
-bt
n"
:style=
"
{
top: buttonTop + 'px'
}"
@click="show = !show"
>
<
Close
class=
"icon"
v-show=
"show"
/>
<
Setting
class=
"icon"
v-show=
"!show"
/>
<
i-ep-close
v-show=
"show"
/>
<
i-ep-setting
v-show=
"!show"
/>
</div>
<div
class=
"right-panel__items"
>
<div>
<slot
/>
</div>
</div>
</div>
</
template
>
<
style
>
<
style
lang=
"scss"
scoped
>
.showRightPanel
{
overflow
:
hidden
;
position
:
relative
;
width
:
calc
(
100%
-
15px
);
}
</
style
>
<
style
lang=
"scss"
scoped
>
.right-panel-background
{
.right-panel-overlay
{
position
:
fixed
;
top
:
0
;
left
:
0
;
opacity
:
0
;
transition
:
opacity
0
.3s
cubic-bezier
(
0
.7
,
0
.3
,
0
.1
,
1
);
background
:
rgba
(
0
,
0
,
0
,
0
.2
);
z-index
:
-1
;
}
.right-panel
{
background-color
:
var
(
--
el-bg-color
);
.right-panel
-container
{
background-color
:
var
(
--
el-bg-color
-overlay
);
width
:
100%
;
max-width
:
300px
;
height
:
100vh
;
...
...
@@ -114,42 +97,37 @@ onBeforeUnmount(() => {
box-shadow
:
0px
0px
15px
0px
rgba
(
0
,
0
,
0
,
0
.05
);
transition
:
all
0
.25s
cubic-bezier
(
0
.7
,
0
.3
,
0
.1
,
1
);
transform
:
translate
(
100%
);
z-index
:
199
;
.icon
{
width
:
1em
;
height
:
1em
;
vertical-align
:
middle
;
}
z-index
:
999
;
}
.show
{
transition
:
all
0
.3s
cubic-bezier
(
0
.7
,
0
.3
,
0
.1
,
1
);
.right-panel-
background
{
.right-panel-
overlay
{
z-index
:
99
;
opacity
:
1
;
width
:
100%
;
height
:
100%
;
}
.right-panel
{
.right-panel
-container
{
transform
:
translate
(
0
);
}
}
.right-panel
__butto
n
{
.right-panel
-bt
n
{
background-color
:
var
(
--
el-color-primary
);
color
:
var
(
--
el-color-white
);
width
:
48px
;
height
:
48px
;
left
:
-48px
;
line-height
:
48px
;
width
:
36px
;
height
:
36px
;
left
:
-36px
;
position
:
absolute
;
text-align
:
center
;
font-size
:
24px
;
border-radius
:
6px
0
0
6px
;
z-index
:
0
;
pointer-events
:
auto
;
cursor
:
pointer
;
svg
{
vertical-align
:
-10px
;
width
:
20px
;
height
:
20px
;
}
}
</
style
>
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录