Skip to content
This repository has been archived by the owner on Jul 12, 2020. It is now read-only.

Commit

Permalink
Add dismissible box feature
Browse files Browse the repository at this point in the history
Let's add an attribute to the <box> feature that allows users to dismiss the box by clicking on a 'x' button.
  • Loading branch information
alyip98 committed May 30, 2019
1 parent 386e3f0 commit 2fa9ad9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/TipBox.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,25 @@
<template>
<div class="alert container" :class="[boxStyle, addClass]" :style="customStyle">
<div class="alert container" :class="[boxStyle, addClass, {'alert-dismissible': dismissible}]" :style="customStyle">
<div class="icon-wrapper" v-if="!isDefault">
<span v-html="iconType"></span>
</div>
<div class="contents">
<slot></slot>
</div>
<button type="button" class="close" data-dismiss="alert" aria-label="Close" v-if="dismissible">
<span aria-hidden="true">&times;</span>
</button>
</div>
</template>

<script>
import md from './utils/markdown.js'
export default {
props: {
dismissible: {
type: Boolean,
default: false
},
backgroundColor: {
type: String,
default: null
Expand Down

0 comments on commit 2fa9ad9

Please sign in to comment.