Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
admin-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Angelina Filippova
admin-fe
Commits
9ba1ea69
Commit
9ba1ea69
authored
6 years ago
by
Pan
Browse files
Options
Downloads
Patches
Plain Diff
perf[el-dragDialog]: add dragDialog callback function
parent
320e941d
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/directive/el-dragDialog/drag.js
+4
-1
4 additions, 1 deletion
src/directive/el-dragDialog/drag.js
src/views/components-demo/dragDialog.vue
+18
-1
18 additions, 1 deletion
src/views/components-demo/dragDialog.vue
with
22 additions
and
2 deletions
src/directive/el-dragDialog/drag.js
+
4
−
1
View file @
9ba1ea69
export
default
{
bind
(
el
,
binding
)
{
bind
(
el
,
binding
,
vnode
)
{
const
dialogHeaderEl
=
el
.
querySelector
(
'
.el-dialog__header
'
)
const
dragDom
=
el
.
querySelector
(
'
.el-dialog
'
)
dialogHeaderEl
.
style
.
cssText
+=
'
;cursor:move;
'
...
...
@@ -63,6 +63,9 @@ export default{
// 移动当前元素
dragDom
.
style
.
cssText
+=
`;left:
${
left
+
styL
}
px;top:
${
top
+
styT
}
px;`
// emit onDrag event
vnode
.
child
.
$emit
(
'
dragDialog
'
)
}
document
.
onmouseup
=
function
(
e
)
{
...
...
This diff is collapsed.
Click to expand it.
src/views/components-demo/dragDialog.vue
+
18
−
1
View file @
9ba1ea69
<
template
>
<div
class=
"components-container"
>
<el-button
type=
"primary"
@
click=
"dialogTableVisible = true"
>
open a Drag Dialog
</el-button>
<el-dialog
v-el-drag-dialog
title=
"Shipping address"
:visible.sync=
"dialogTableVisible"
>
<el-dialog
v-el-drag-dialog
@
dragDialog=
"handleDrag"
title=
"Shipping address"
:visible.sync=
"dialogTableVisible"
>
<el-select
ref=
"select"
v-model=
"value"
placeholder=
"请选择"
>
<el-option
v-for=
"item in options"
:key=
"item.value"
:label=
"item.label"
:value=
"item.value"
>
</el-option>
</el-select>
<el-table
:data=
"gridData"
>
<el-table-column
property=
"date"
label=
"Date"
width=
"150"
></el-table-column>
<el-table-column
property=
"name"
label=
"Name"
width=
"200"
></el-table-column>
...
...
@@ -20,6 +24,13 @@ export default {
data
()
{
return
{
dialogTableVisible
:
false
,
options
:
[
{
value
:
'
选项1
'
,
label
:
'
黄金糕
'
},
{
value
:
'
选项2
'
,
label
:
'
双皮奶
'
},
{
value
:
'
选项3
'
,
label
:
'
蚵仔煎
'
},
{
value
:
'
选项4
'
,
label
:
'
龙须面
'
}
],
value
:
''
,
gridData
:
[{
date
:
'
2016-05-02
'
,
name
:
'
John Smith
'
,
...
...
@@ -38,6 +49,12 @@ export default {
address
:
'
No.1518, Jinshajiang Road, Putuo District
'
}]
}
},
methods
:
{
// v-el-drag-dialog onDrag callback function
handleDrag
()
{
this
.
$refs
.
select
.
blur
()
}
}
}
</
script
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment