88 >
99 <div :class =" dialogClasses" role =" document" >
1010 <div :class =" contentClasses" >
11- <slot v-if =" !noHeader" name =" header-wrapper"
12- >
13- <header class =" modal-header" >
11+ <slot name =" header-wrapper" >
12+ <header class =" modal-header" >
1413 <slot name =" header" >
1514 <h5 class =" modal-title" >
1615 {{title}}
2625 </slot >
2726 </header >
2827 </slot >
29- <slot v-if = " !noBody " name =" body-wrapper" >
28+ <slot name =" body-wrapper" >
3029 <div class =" modal-body" >
3130 <slot ></slot >
3231 </div >
3332 </slot >
34- <slot v-if = " !noFooter " name =" footer-wrapper" >
33+ <slot name =" footer-wrapper" >
3534 <footer class =" modal-footer" >
3635 <slot name =" footer" >
3736 <button
5554 </div >
5655 </div >
5756 <div
58- v-if =" !noBackdrop && (visible || isTransitioning)"
57+ v-if =" backdrop && (visible || isTransitioning)"
5958 :class =" backdropClasses"
6059 >
6160 </div >
@@ -75,12 +74,18 @@ export default {
7574 },
7675 color: String ,
7776 borderColor: String ,
78- noFade: Boolean ,
79- noBackdrop: Boolean ,
80- noCloseOnBackdrop: Boolean ,
81- noHeader: Boolean ,
82- noBody: Boolean ,
83- noFooter: Boolean ,
77+ fade: {
78+ type: Boolean ,
79+ default: true
80+ },
81+ backdrop: {
82+ type: Boolean ,
83+ default: true
84+ },
85+ closeOnBackdrop: {
86+ type: Boolean ,
87+ default: true
88+ },
8489 addModalClasses: [String , Array , Object ],
8590 addDialogClasses: [String , Array , Object ],
8691 addContentClasses: [String , Array , Object ]
@@ -96,17 +101,16 @@ export default {
96101 backdropClasses () {
97102 return {
98103 ' modal-backdrop' : true ,
99- ' fade' : ! this .noFade ,
100- ' show' : this .visible || this .noFade
104+ ' fade' : this .fade ,
105+ ' show' : this .visible || ! this .fade
101106 }
102107 },
103108 modalClasses () {
104109 return [
105110 ' modal overflow-auto' ,
106111 this .addModalClasses ,
107112 {
108- // 'close-modal': !this.noCloseOnBackdrop,
109- ' fade' : ! this .noFade ,
113+ ' fade' : this .fade ,
110114 ' show' : this .visible ,
111115 ' d-block' : this .visible || this .isTransitioning ,
112116 [` modal-${ this .color } ` ]: Boolean (this .color )
@@ -143,7 +147,7 @@ export default {
143147 },
144148 methods: {
145149 modalClick (e ) {
146- if (e .target === this .$el .firstElementChild && ! this .noCloseOnBackdrop ) {
150+ if (e .target === this .$el .firstElementChild && this .closeOnBackdrop ) {
147151 this .hide (e)
148152 }
149153 },
@@ -153,7 +157,7 @@ export default {
153157 },
154158 toggle (newVal ) {
155159 setTimeout (() => { this .visible = newVal }, 0 )
156- if (! this .noFade ) {
160+ if (this .fade ) {
157161 this .isTransitioning = true
158162 clearTimeout (this .timeout )
159163 this .timeout = setTimeout (() => {
0 commit comments