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
5d554f18
Commit
5d554f18
authored
Jun 03, 2021
by
无木
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(modal): redoModalHeight not work as expected
修复redoModalHeight根据内容重设高度时,只会增大而不能减少Modal高度的问题
parent
f732b569
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
15 deletions
+27
-15
ModalWrapper.vue
src/components/Modal/src/components/ModalWrapper.vue
+7
-9
Modal1.vue
src/views/demo/comp/modal/Modal1.vue
+20
-6
No files found.
src/components/Modal/src/components/ModalWrapper.vue
View file @
5d554f18
...
...
@@ -60,15 +60,13 @@
redoModalHeight
:
setModalHeight
,
});
const
spinStyle
=
computed
(
():
CSSProperties
=>
{
return
{
minHeight
:
`
${
props
.
minHeight
}
px`
,
// padding 28
height
:
`
${
unref
(
realHeightRef
)}
px`
,
};
}
);
const
spinStyle
=
computed
(():
CSSProperties
=>
{
return
{
minHeight
:
`
${
props
.
minHeight
}
px`
,
// padding 28
maxHeight
:
`
${
unref
(
realHeightRef
)}
px`
,
};
});
watchEffect
(()
=>
{
props
.
useWrapper
&&
setModalHeight
();
...
...
src/views/demo/comp/modal/Modal1.vue
View file @
5d554f18
...
...
@@ -7,6 +7,9 @@
:helpMessage=
"['提示1', '提示2']"
@
visible-change=
"handleShow"
>
<template
#insertFooter
>
<a-button
type=
"danger"
@
click=
"setLines"
:disabled=
"loading"
>
点我更新内容
</a-button>
</
template
>
<
template
v-if=
"loading"
>
<div
class=
"empty-tips"
>
加载中,稍等3秒……
</div>
</
template
>
...
...
@@ -18,7 +21,7 @@
</BasicModal>
</template>
<
script
lang=
"ts"
>
import
{
defineComponent
,
ref
}
from
'
vue
'
;
import
{
defineComponent
,
ref
,
watch
}
from
'
vue
'
;
import
{
BasicModal
,
useModalInner
}
from
'
/@/components/Modal
'
;
export
default
defineComponent
({
components
:
{
BasicModal
},
...
...
@@ -26,19 +29,30 @@
const
loading
=
ref
(
true
);
const
lines
=
ref
(
10
);
const
[
register
,
{
setModalProps
,
redoModalHeight
}]
=
useModalInner
();
watch
(
()
=>
lines
.
value
,
()
=>
{
redoModalHeight
();
}
);
function
handleShow
(
visible
:
boolean
)
{
if
(
visible
)
{
loading
.
value
=
true
;
setModalProps
({
loading
:
true
});
setModalProps
({
loading
:
true
,
confirmLoading
:
true
});
setTimeout
(()
=>
{
lines
.
value
=
Math
.
round
(
Math
.
random
()
*
20
+
10
);
lines
.
value
=
Math
.
round
(
Math
.
random
()
*
30
+
5
);
loading
.
value
=
false
;
setModalProps
({
loading
:
false
});
redoModalHeight
();
setModalProps
({
loading
:
false
,
confirmLoading
:
false
});
},
3000
);
}
}
return
{
register
,
loading
,
handleShow
,
lines
};
function
setLines
()
{
lines
.
value
=
Math
.
round
(
Math
.
random
()
*
20
+
10
);
}
return
{
register
,
loading
,
handleShow
,
lines
,
setLines
};
},
});
</
script
>
...
...
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