Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
npm
/
glsx-components
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 6f94f725
authored
Jul 21, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat:调整弹窗尺寸
1 parent
bb3b5ccc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
11 deletions
package-lock.json
package.json
src/App.vue
src/packages/GLDialog/src/index.vue
package-lock.json
View file @
6f94f72
This diff is collapsed.
Click to expand it.
package.json
View file @
6f94f72
...
...
@@ -17,9 +17,9 @@
"dependencies"
:
{
"core-js"
:
"^3.6.5"
,
"element-ui"
:
"^2.15.6"
,
"glsx-common"
:
"^1.
3.2
"
,
"vue
draggable"
:
"^2.24.3
"
,
"vue
"
:
"^2.6.11
"
"glsx-common"
:
"^1.
4.9
"
,
"vue
"
:
"^2.6.11
"
,
"vue
draggable"
:
"^2.24.3
"
},
"devDependencies"
:
{
"@vue/babel-helper-vue-jsx-merge-props"
:
"^1.2.1"
,
...
...
src/App.vue
View file @
6f94f72
...
...
@@ -125,13 +125,15 @@
<!-- 测试业务组件GLBcTest -->
<GLBcTest></GLBcTest>
<hr
/>
<!-- 测试GLFull -->
<GLFull>
SDK发就算冷冻机房乐山大佛
</GLFull>
<hr
/>
<!-- 测试弹框组件 -->
<el-button
plain
@
click=
"testDialog(1)"
>
dialog(大)
</el-button>
<el-button
plain
@
click=
"testDialog2"
>
dialog(中)
</el-button>
<el-button
plain
@
click=
"showDialog"
>
dialog(小)
</el-button>
<el-button
plain
@
click=
"testDialog3"
>
dialog(中)无按钮
</el-button>
<el-button
plain
@
click=
"testBeforeDialog"
>
之前小弹窗
</el-button>
<GLFull>
SDK发就算冷冻机房乐山大佛
</GLFull>
<!-- :content="'hello HelloWorld'" -->
<GLDialog
:mode=
"mode"
bigTitle=
"大标题"
:hasFooter=
"hasFooter"
:type=
"'error'"
@
onOk=
"handleOk"
@
onCancel=
"handleCancel"
:visible
.
sync=
"dialogShow"
>
<div>
...
...
@@ -203,7 +205,7 @@
</span> -->
</GLDialog>
<GLDialog
:mode=
"mode"
title=
"提示"
:hasFooter=
"hasFooter"
:type=
"'error'"
:content=
"'hello HelloWorld'"
@
onOk=
"handleOk"
@
onCancel=
"handleCancel"
:visible
.
sync=
"dialogShow2"
></GLDialog>
<GLDialog
title=
"提示123"
:mode=
"mode"
:hasFooter=
"hasFooter"
:type=
"'
error
'"
:content=
"'hello HelloWorld'"
@
onOk=
"handleOk"
@
onCancel=
"handleCancel"
:visible
.
sync=
"dialogShow1"
></GLDialog>
<GLDialog
title=
"提示123"
:mode=
"mode"
:hasFooter=
"hasFooter"
:type=
"'
info
'"
:content=
"'hello HelloWorld'"
@
onOk=
"handleOk"
@
onCancel=
"handleCancel"
:visible
.
sync=
"dialogShow1"
></GLDialog>
<hr
/>
</div>
</template>
...
...
src/packages/GLDialog/src/index.vue
View file @
6f94f72
<
template
>
<div
class=
"gl-dialog-wrap "
:class=
"mode"
>
<div
class=
"gl-dialog-wrap "
:class=
"mode"
@
keyup
.
esc=
"escFn"
>
<el-dialog
v-bind=
"$attrs"
v-on=
"$listeners"
>
<template
v-slot:title
>
<!-- 标题插槽 -->
...
...
@@ -96,7 +96,7 @@ export default {
}
},
mounted
()
{
console
.
log
(
'slots'
,
this
.
$slots
)
//
console.log('slots',this.$slots)
document
.
addEventListener
(
'fullscreenchange'
,
()
=>
{
this
.
fullscreenchangeFn
()
})
...
...
@@ -154,12 +154,41 @@ export default {
// 这是取消事件
this
.
$emit
(
'onCancel'
)
},
escFn
(){
setTimeout
(()
=>
{
this
.
isFull
=
false
this
.
exitFullscreenHook
()
},
300
)
},
fullScreenFn
()
{
if
(
document
.
fullscreenElement
)
{
this
.
exitFullscreen
()
}
else
{
this
.
launchFullscreen
(
document
.
documentElement
)
if
(
this
.
isFull
){
this
.
exitFullscreenHook
()
this
.
isFull
=
false
}
else
{
this
.
fullScreenHook
()
this
.
isFull
=
true
}
// if (document.fullscreenElement) {
// this.exitFullscreen()
// } else {
// this.launchFullscreen(document.documentElement)
// }
},
fullScreenHook
(){
const
dialog
=
document
.
querySelector
(
'.el-dialog'
)
const
dialogBody
=
document
.
querySelector
(
'.el-dialog__body'
)
dialog
.
style
.
margin
=
0
dialog
.
style
.
width
=
window
.
innerWidth
+
'px'
dialog
.
style
.
height
=
window
.
innerHeight
+
'px'
dialogBody
.
style
.
maxHeight
=
window
.
innerHeight
-
60
-
40
-
64
+
'px'
},
exitFullscreenHook
(){
const
dialog
=
document
.
querySelector
(
'.el-dialog'
)
const
dialogBody
=
document
.
querySelector
(
'.el-dialog__body'
)
dialog
.
style
.
margin
=
'15vh auto 50px'
dialog
.
style
.
width
=
1080
+
'px'
dialog
.
style
.
height
=
'auto'
dialogBody
.
style
.
maxHeight
=
'586px'
},
launchFullscreen
(
element
)
{
if
(
element
.
requestFullscreen
)
{
...
...
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