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 de93074b
authored
Jul 22, 2022
by
luyt
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
other:替换keyup监听事件为addEventListener
1 parent
dae46afe
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
30 deletions
src/packages/GLDialog/src/index.vue
src/packages/GLDialog/src/index.vue
View file @
de93074
<
template
>
<
template
>
<div
class=
"gl-dialog-wrap "
:class=
"mode"
:id=
"idDom"
@
keyup
.
esc=
"escFn"
>
<div
class=
"gl-dialog-wrap "
:class=
"mode"
:id=
"idDom"
>
<el-dialog
v-bind=
"$attrs"
v-on=
"$listeners"
>
<el-dialog
v-bind=
"$attrs"
v-on=
"$listeners"
>
<template
v-slot:title
>
<template
v-slot:title
>
<!-- 标题插槽 -->
<!-- 标题插槽 -->
...
@@ -96,6 +96,11 @@ export default {
...
@@ -96,6 +96,11 @@ export default {
idDom
:
Math
.
random
().
toString
(
36
).
slice
(
-
8
)
idDom
:
Math
.
random
().
toString
(
36
).
slice
(
-
8
)
}
}
},
},
mounted
(){
document
.
addEventListener
(
'keyup'
,
(
e
)
=>
{
this
.
keyupHook
(
e
)
});
},
computed
:
{
computed
:
{
okName
:
function
()
{
okName
:
function
()
{
let
resName
let
resName
...
@@ -178,42 +183,28 @@ export default {
...
@@ -178,42 +183,28 @@ export default {
const
rootdom
=
document
.
getElementById
(
this
.
idDom
)
const
rootdom
=
document
.
getElementById
(
this
.
idDom
)
const
dialog
=
rootdom
.
getElementsByClassName
(
'el-dialog'
)[
0
]
const
dialog
=
rootdom
.
getElementsByClassName
(
'el-dialog'
)[
0
]
const
dialogBody
=
rootdom
.
getElementsByClassName
(
'el-dialog__body'
)[
0
]
const
dialogBody
=
rootdom
.
getElementsByClassName
(
'el-dialog__body'
)[
0
]
if
(
dialogBody
){
// dialogBody.style.maxHeight = '586px'
dialogBody
.
style
.
minHeight
=
'156px'
}
dialog
.
style
.
margin
=
'15vh auto 50px'
dialog
.
style
.
margin
=
'15vh auto 50px'
dialog
.
style
.
width
=
1080
+
'px'
dialog
.
style
.
width
=
1080
+
'px'
dialog
.
style
.
height
=
'auto'
dialog
.
style
.
height
=
'auto'
// dialogBody.style.maxHeight = '586px'
dialogBody
.
style
.
minHeight
=
'156px'
},
launchFullscreen
(
element
)
{
if
(
element
.
requestFullscreen
)
{
element
.
requestFullscreen
()
}
else
if
(
element
.
mozRequestFullScreen
)
{
element
.
mozRequestFullScreen
()
}
else
if
(
element
.
msRequestFullscreen
)
{
element
.
msRequestFullscreen
()
}
else
if
(
element
.
webkitRequestFullscreen
)
{
element
.
webkitRequestFullScreen
()
}
},
exitFullscreen
()
{
if
(
document
.
exitFullscreen
)
{
document
.
exitFullscreen
()
}
else
if
(
document
.
msExitFullscreen
)
{
document
.
msExitFullscreen
()
}
else
if
(
document
.
mozCancelFullScreen
)
{
document
.
mozCancelFullScreen
()
}
else
if
(
document
.
webkitExitFullscreen
)
{
document
.
webkitExitFullscreen
()
}
},
},
fullscreenchangeFn
()
{
keyupHook
(
e
)
{
if
(
document
.
fullscreenElement
)
{
if
(
this
.
isFull
)
{
this
.
isFull
=
true
if
(
e
.
key
===
'Escape'
){
}
else
{
this
.
escFn
()
this
.
isFull
=
false
}
}
}
}
}
},
},
beforeDestroy
(){
document
.
removeEventListener
(
'keyup'
,(
e
)
=>
{
this
.
keyupHook
(
e
)
})
}
}
}
</
script
>
</
script
>
...
...
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