Skip to content
This repository was archived by the owner on Jan 9, 2022. It is now read-only.

Commit fea0e22

Browse files
committed
feat: make customization for transition
1 parent 224cc2a commit fea0e22

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/components/GDialog.vue

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@click="onClickOutside"
1010
/>
1111

12-
<Transition name="dialog-transition">
12+
<Transition :name="transition">
1313
<div
1414
v-show="isActive"
1515
ref="contentFrame"
@@ -111,6 +111,11 @@ export default defineComponent({
111111
default: false,
112112
},
113113
114+
transition: {
115+
type: String,
116+
default: 'g-dialog-transition',
117+
},
118+
114119
width: {
115120
type: [String, Number],
116121
default: 'auto',
@@ -198,17 +203,23 @@ export default defineComponent({
198203
left: 0;
199204
position: fixed;
200205
top: 0;
201-
transition: 0.2s cubic-bezier(0.25, 0.8, 0.25, 1), z-index 1ms;
206+
transition-duration: 0.2s;
207+
transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
202208
width: 100%;
203209
outline: none;
204210
pointer-events: none;
205211
z-index: 201;
206212
}
207213
208-
.dialog-transition {
209-
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
214+
.g-dialog-transition {
210215
opacity: 0;
211216
217+
&-enter-active,
218+
&-leave-active {
219+
transition-timing-function: cubic-bezier(0.25, 0.8, 0.25, 1);
220+
transition-duration: 0.2s;
221+
}
222+
212223
&-enter-from,
213224
&-leave-to {
214225
transform: scale(0.5);

0 commit comments

Comments
 (0)