Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Commit

Permalink
Added size prop to modal
Browse files Browse the repository at this point in the history
  • Loading branch information
romanslonov committed Apr 2, 2019
1 parent fc52a12 commit 9e35fea
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/Modal/main.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<transition name="modal" @after-enter="onEnter" @after-leave="onLeave">
<div class="modal modal__mask" v-show="open" :role="role">
<div class="modal modal__mask" v-show="open" :role="role" :class="classes">
<div ref="backdrop" class="modal__wrapper" @click="dismissOnBackdrop && close($event)">
<div
ref="container"
Expand Down Expand Up @@ -59,6 +59,13 @@ export default {
type: String,
default: 'Modal title',
},
size: {
type: String,
default: '2',
validator(size) {
return ['1', '2', '3'].indexOf(size) > -1;
},
},
dismissible: {
type: Boolean,
default: true,
Expand All @@ -78,6 +85,11 @@ export default {
dismissOnEsc() {
return this.dismissOn.indexOf('esc') > -1;
},
classes() {
return [
`modal--size-${this.size}`,
];
},
},
methods: {
close(e) {
Expand Down

0 comments on commit 9e35fea

Please sign in to comment.