+
+
@@ -58,6 +67,25 @@ export default {
type: Number,
default: 1,
},
+
+ // Whether the header title should be uppercase
+ uppercase: {
+ type: Boolean,
+ default: true,
+ },
+
+ // Extra buttons to be added to the modal header
+ buttons: {
+ type: Array,
+ default: () => [],
+ },
+
+ // A function to be called before the modal is closed.
+ // If the function returns false, the modal will not be closed.
+ beforeClose: {
+ type: Function,
+ default: () => true,
+ },
},
data() {
@@ -76,6 +104,9 @@ export default {
methods: {
close() {
+ if (this.beforeClose && !this.beforeClose())
+ return
+
this.prevVisible = this.isVisible
this.isVisible = false
},
@@ -206,13 +237,20 @@ $icon-margin: 0.5em;
justify-content: center;
align-items: center;
background: $modal-header-bg;
- text-transform: uppercase;
+
+ &.uppercase {
+ text-transform: uppercase;
+ }
+
+ .buttons {
+ width: auto;
+ position: absolute;
+ right: 0;
+ }
button {
width: $icon-size;
height: $icon-size;
- position: absolute;
- right: 0;
margin: auto $icon-margin;
padding: 0;
border: 0;
-
+