Files
aurora-admin/frameworks/AlertModal.vue2.vue
T

33 lines
984 B
Vue

<template>
<div class="aa-modal-mask" v-if="visible" @click.self="$emit('ok')">
<div class="aa-alert" :class="'is-' + type">
<div class="aa-alert-head">
<span class="aa-alert-icon">{{ iconMap[type] || 'i' }}</span>
<div class="aa-alert-title">{{ title }}</div>
</div>
<div class="aa-alert-content">{{ content }}</div>
<div class="aa-alert-footer">
<button class="aa-alert-btn" @click="$emit('ok')">{{ okText }}</button>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'AaAlertModal',
props: {
visible: { type: Boolean, default: false },
type: { type: String, default: 'info' },
title: { type: String, default: '提示' },
content: { type: String, default: '' },
okText: { type: String, default: '知道了' }
},
data: function () {
return { iconMap: { success: '✓', error: '✕', warning: '!', info: 'i' } };
}
};
</script>
<style src="./AlertModal.css"></style>