Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
de12babd
Commit
de12babd
authored
Jun 10, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(modal): add v-model support for visible
parent
b387681c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
BasicModal.vue
src/components/Modal/src/BasicModal.vue
+5
-4
ModalClose.vue
src/components/Modal/src/components/ModalClose.vue
+2
-2
ModalFooter.vue
src/components/Modal/src/components/ModalFooter.vue
+4
-4
No files found.
src/components/Modal/src/BasicModal.vue
View file @
de12babd
...
...
@@ -81,7 +81,7 @@
components
:
{
Modal
,
ModalWrapper
,
ModalClose
,
ModalFooter
,
ModalHeader
},
inheritAttrs
:
false
,
props
:
basicProps
,
emits
:
[
'
visible-change
'
,
'
height-change
'
,
'
cancel
'
,
'
ok
'
,
'
register
'
],
emits
:
[
'
visible-change
'
,
'
height-change
'
,
'
cancel
'
,
'
ok
'
,
'
register
'
,
'
update:visible
'
],
setup
(
props
,
{
emit
,
attrs
})
{
const
visibleRef
=
ref
(
false
);
const
propsRef
=
ref
<
Partial
<
ModalProps
>
|
null
>
(
null
);
...
...
@@ -157,6 +157,7 @@
()
=>
unref
(
visibleRef
),
(
v
)
=>
{
emit
(
'
visible-change
'
,
v
);
emit
(
'
update:visible
'
,
v
);
instance
&&
modalMethods
.
emitVisible
?.(
v
,
instance
.
uid
);
nextTick
(()
=>
{
if
(
props
.
scrollTop
&&
v
&&
unref
(
modalWrapperRef
))
{
...
...
@@ -180,7 +181,7 @@
}
visibleRef
.
value
=
false
;
emit
(
'
cancel
'
);
emit
(
'
cancel
'
,
e
);
}
/**
...
...
@@ -193,8 +194,8 @@
visibleRef
.
value
=
!!
props
.
visible
;
}
function
handleOk
()
{
emit
(
'
ok
'
);
function
handleOk
(
e
:
Event
)
{
emit
(
'
ok
'
,
e
);
}
function
handleHeightChange
(
height
:
string
)
{
...
...
src/components/Modal/src/components/ModalClose.vue
View file @
de12babd
...
...
@@ -35,8 +35,8 @@
];
});
function
handleCancel
()
{
emit
(
'
cancel
'
);
function
handleCancel
(
e
:
Event
)
{
emit
(
'
cancel
'
,
e
);
}
function
handleFullScreen
(
e
:
Event
)
{
e
?.
stopPropagation
();
...
...
src/components/Modal/src/components/ModalFooter.vue
View file @
de12babd
...
...
@@ -26,12 +26,12 @@
props
:
basicProps
,
emits
:
[
'
ok
'
,
'
cancel
'
],
setup
(
_
,
{
emit
})
{
function
handleOk
()
{
emit
(
'
ok
'
);
function
handleOk
(
e
:
Event
)
{
emit
(
'
ok
'
,
e
);
}
function
handleCancel
()
{
emit
(
'
cancel
'
);
function
handleCancel
(
e
:
Event
)
{
emit
(
'
cancel
'
,
e
);
}
return
{
handleOk
,
handleCancel
};
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment