|
@@ -4,7 +4,9 @@
|
|
|
<i class="el-alert__icon" :class="[ iconClass, isBigIcon ]" v-if="showIcon"></i>
|
|
|
<div class="el-alert__content">
|
|
|
<span class="el-alert__title" :class="[ isBoldTitle ]" v-if="title">{{ title }}</span>
|
|
|
- <desc-content></desc-content>
|
|
|
+ <slot>
|
|
|
+ <p class="el-alert__description" v-if="description">{{ description }}</p>
|
|
|
+ </slot>
|
|
|
<i class="el-alert__closebtn" :class="{ 'is-customed': closeText !== '', 'el-icon-close': closeText === '' }" v-show="closable" @click="close()">{{closeText}}</i>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -45,8 +47,7 @@
|
|
|
showIcon: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
- },
|
|
|
- renderContent: Function
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
data() {
|
|
@@ -55,21 +56,6 @@
|
|
|
};
|
|
|
},
|
|
|
|
|
|
- components: {
|
|
|
- descContent: {
|
|
|
- render(h) {
|
|
|
- const parent = this.$parent;
|
|
|
- if (parent.renderContent) {
|
|
|
- return parent.renderContent(h);
|
|
|
- } else if (parent.description) {
|
|
|
- return <p class="el-alert__description">{ parent.description }</p>;
|
|
|
- } else {
|
|
|
- return '';
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
methods: {
|
|
|
close() {
|
|
|
this.visible = false;
|