Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
micro-system
/
micro-portal
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a035efa0
authored
Dec 18, 2020
by
冒粤蓉
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
add fullscreen icon
1 parent
10ef3315
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
86 additions
and
1 deletions
src/components/DesktopTopSider/DesktopTopSider.vue
src/components/DesktopTopSider/Sub/FullScreen.vue
src/views/Dashboard.vue
src/components/DesktopTopSider/DesktopTopSider.vue
View file @
a035efa
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
<div
class=
"right-btn"
>
<div
class=
"right-btn"
>
<!-- 设置按钮 -->
<!-- 设置按钮 -->
<!--
<setting-button></setting-button>
-->
<!--
<setting-button></setting-button>
-->
<!-- 全屏按钮 -->
<full-screen></full-screen>
<!-- 用户按钮 -->
<!-- 用户按钮 -->
<user-button></user-button>
<user-button></user-button>
</div>
</div>
...
@@ -26,6 +28,7 @@
...
@@ -26,6 +28,7 @@
<
script
>
<
script
>
import
SettingButton
from
'./Sub/SettingButton'
;
import
SettingButton
from
'./Sub/SettingButton'
;
import
UserButton
from
'./Sub/UserButton'
;
import
UserButton
from
'./Sub/UserButton'
;
import
FullScreen
from
'./Sub/FullScreen'
;
import
{
import
{
MenuUnfoldOutlined
,
MenuUnfoldOutlined
,
MenuFoldOutlined
,
MenuFoldOutlined
,
...
@@ -44,7 +47,8 @@ export default {
...
@@ -44,7 +47,8 @@ export default {
MenuUnfoldOutlined
,
MenuUnfoldOutlined
,
MenuFoldOutlined
,
MenuFoldOutlined
,
SettingOutlined
,
SettingOutlined
,
UserOutlined
UserOutlined
,
FullScreen
},
},
setup
(
props
,
context
)
{
setup
(
props
,
context
)
{
const
store
=
useStore
();
const
store
=
useStore
();
...
...
src/components/DesktopTopSider/Sub/FullScreen.vue
0 → 100644
View file @
a035efa
<
template
>
<div>
<FullscreenOutlined
id=
"full-screen-btn"
v-show=
"fullScreen"
class=
"top-nav-right-btn full-screen-btn"
@
click=
"fullScreen(true)"
/>
</div>
</
template
>
<
script
>
import
{
FullscreenOutlined
,
FullscreenExitOutlined
}
from
'@ant-design/icons-vue'
;
import
{
reactive
,
toRefs
,
onMounted
}
from
'vue'
;
export
default
{
name
:
'SettingButton'
,
data
()
{
return
{
fullscreen
:
true
,
fullarea
:
''
}
},
components
:
{
FullscreenOutlined
},
setup
()
{
const
state
=
reactive
({
fullscreen
:
true
,
fullarea
:
''
});
onMounted
(()
=>
{
state
.
fullarea
=
document
.
getElementById
(
'sub-system-frame'
);
})
// 登出操作
const
fullScreen
=
(
isFull
)
=>
{
let
{
fullarea
}
=
state
;
if
(
isFull
)
{
// 进入全屏
if
(
fullarea
.
requestFullscreen
)
{
fullarea
.
requestFullscreen
();
}
else
if
(
fullarea
.
webkitRequestFullScreen
)
{
fullarea
.
webkitRequestFullScreen
();
}
else
if
(
fullarea
.
mozRequestFullScreen
)
{
fullarea
.
mozRequestFullScreen
();
}
else
if
(
fullarea
.
msRequestFullscreen
)
{
// IE11
fullarea
.
msRequestFullscreen
();
}
}
else
{
// 退出全屏
if
(
document
.
exitFullscreen
)
{
document
.
exitFullscreen
();
}
else
if
(
document
.
webkitCancelFullScreen
)
{
document
.
webkitCancelFullScreen
();
}
else
if
(
document
.
mozCancelFullScreen
)
{
document
.
mozCancelFullScreen
();
}
else
if
(
document
.
msExitFullscreen
)
{
document
.
msExitFullscreen
();
}
}
}
return
{
...
toRefs
(
state
),
fullScreen
}
}
}
</
script
>
<
style
lang=
"less"
scoped
>
@import
'styles/common.less'
;
@import
'styles/variables.less'
;
.full-screen-btn
{
display
:
block
;
font-size
:
20px
;
color
:
@
defaultThemeColor
;
}
</
style
>
src/views/Dashboard.vue
View file @
a035efa
...
@@ -47,6 +47,10 @@ export default {
...
@@ -47,6 +47,10 @@ export default {
.container
{
.container
{
height
:
100vh
;
height
:
100vh
;
#desktop-right-sider
{
overflow-x
:
scroll
;
}
#desktop-right-sider
.trigger
{
#desktop-right-sider
.trigger
{
font-size
:
18px
;
font-size
:
18px
;
line-height
:
64px
;
line-height
:
64px
;
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment