-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ab7fe46
commit 699af4c
Showing
10 changed files
with
440 additions
and
453 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,44 @@ | ||
<template> | ||
<div class="alerts"> | ||
<div v-for="alert in alerts" v-bind:class="alert.type" transition="expand"> | ||
<p> | ||
{{alert.message}} | ||
</p> | ||
</div> | ||
</div> | ||
<template lang="pug"> | ||
div(class="alerts") | ||
div(v-for="alert in alerts" v-bind:class="alert.type" transition="expand") | ||
p {{alert.message}} | ||
</template> | ||
<script> | ||
export default { | ||
props: ['alerts'] | ||
} | ||
</script> | ||
<style> | ||
.alerts{ | ||
position: fixed; | ||
top: 50px; | ||
left: 0; | ||
right: 0; | ||
z-index: 1; | ||
} | ||
.alerts div{ | ||
background: #bbb; | ||
overflow: hidden; | ||
} | ||
.alerts div.error{ | ||
background: #e03c3c; | ||
color: #fff; | ||
} | ||
.alerts div.success{ | ||
background: #41b883; | ||
color: #fff; | ||
} | ||
.alerts p{ | ||
width: 480px; | ||
margin: 0 auto; | ||
padding: 4px; | ||
text-align: center; | ||
} | ||
.expand-transition{ | ||
max-height: 200px; /* height 0 -> auto is not animatable, so use max-height 0 -> large height */ | ||
transition: max-height 1s ease; | ||
} | ||
.expand-enter, .expand-leave{ | ||
max-height: 0; | ||
} | ||
<style lang="sass"> | ||
.alerts | ||
position: fixed | ||
top: 50px | ||
left: 0 | ||
right: 0 | ||
z-index: 1 | ||
div | ||
background: #bbb | ||
overflow: hidden | ||
&.error | ||
background: #e03c3c | ||
color: #fff | ||
&.success | ||
background: #41b883 | ||
color: #fff | ||
p | ||
width: 480px | ||
margin: 0 auto | ||
padding: 4px | ||
text-align: center | ||
.expand-transition | ||
max-height: 200px /* height 0 -> auto is not animatable, so use max-height 0 -> large height */ | ||
transition: max-height 1s ease | ||
.expand-enter, .expand-leave | ||
max-height: 0 | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.