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

TipBox.vue: Support different size icons #124

Merged
merged 8 commits into from
Feb 4, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions src/TipBox.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="alert container" :class="[boxStyle, addClass, lightStyle]" :style="customStyle">
<div v-if="!isDefault" class="icon-wrapper">
<div v-if="!isDefault" class="icon-wrapper" :class="[iconStyle]">
<slot name="_icon">
<span v-html="iconType"></span>
</slot>
Expand All @@ -12,7 +12,6 @@
</button>
<slot></slot>
</div>

</div>
</template>

Expand Down Expand Up @@ -40,6 +39,14 @@
type: String,
default: null
},
icon: {
type: String,
default: null
},
iconSize: {
type: String,
default: null
},
type: {
type: String,
default: 'none'
Expand Down Expand Up @@ -147,6 +154,12 @@
default:
return '<i class="fas fa-exclamation"></i>';
}
},
iconStyle() {
if (this.iconSize) {
return `fa-${this.iconSize}`;
}
return '';
}
}
}
Expand Down Expand Up @@ -186,8 +199,6 @@
.icon-wrapper {
display: flex;
margin-right: .5em;
width: 22px;
height: 22px;
}

.contents {
Expand Down