|
@@ -4,7 +4,7 @@
|
|
|
<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>
|
|
|
- <p class="el-alert__description" v-if="description">{{ description }}</p>
|
|
|
+ <desc-content></desc-content>
|
|
|
<i class="el-alert__closebtn" :class="{ 'is-customed': closeText !== '', 'el-icon-close': closeText === '' }" v-show="closable" @click="close()">{{closeText}}</i>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -45,7 +45,8 @@
|
|
|
showIcon: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
|
- }
|
|
|
+ },
|
|
|
+ renderContent: Function
|
|
|
},
|
|
|
|
|
|
data() {
|
|
@@ -54,6 +55,21 @@
|
|
|
};
|
|
|
},
|
|
|
|
|
|
+ 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;
|