当前位置:网站首页>个人组件 - 消息提示
个人组件 - 消息提示
2022-07-05 13:13:00 【摆烂波比】
<script lang="ts" setup name="XtxMessage">
import {
PropType } from 'vue'
defineProps({
type: {
type: String as PropType<'success' | 'error' | 'warning'>,
default: 'success',
},
})
// 定义一个对象,包含三种情况的样式,对象key就是类型字符串
const style = {
warning: {
icon: 'icon-warning',
color: '#E6A23C',
backgroundColor: 'rgb(253, 246, 236)',
borderColor: 'rgb(250, 236, 216)',
},
error: {
icon: 'icon-shanchu',
color: '#F56C6C',
backgroundColor: 'rgb(254, 240, 240)',
borderColor: 'rgb(253, 226, 226)',
},
success: {
icon: 'icon-queren2',
color: '#67C23A',
backgroundColor: 'rgb(240, 249, 235)',
borderColor: 'rgb(225, 243, 216)',
},
}
</script>
<template>
<div class="xtx-message" :style="style[type]">
<i class="iconfont" :class="style[type].icon"></i>
<span class="text"><slot></slot></span>
</div>
</template>
<style scoped lang="less">
.xtx-message {
width: 300px;
height: 50px;
position: fixed;
z-index: 9999;
left: 50%;
margin-left: -150px;
top: 25px;
line-height: 50px;
padding: 0 25px;
border: 1px solid #e4e4e4;
background: #f5f5f5;
color: #999;
border-radius: 4px;
i {
margin-right: 4px;
vertical-align: middle;
}
.text {
vertical-align: middle;
}
}
</style>
边栏推荐
- RHCSA9
- [深度学习论文笔记]TransBTSV2: Wider Instead of Deeper Transformer for Medical Image Segmentation
- DataPipeline双料入选中国信通院2022数智化图谱、数据库发展报告
- Association modeling method in SAP segw transaction code
- 《2022年中國銀行業RPA供應商實力矩陣分析》研究報告正式啟動
- MSTP and eth trunk
- leetcode 10. Regular Expression Matching 正则表达式匹配 (困难)
- Default parameters of function & multiple methods of function parameters
- Binder通信过程及ServiceManager创建过程
- 初次使用腾讯云,解决只能使用webshell连接,不能使用ssh连接。
猜你喜欢

RHCSA8

简单上手的页面请求和解析案例

MySQL 巨坑:update 更新慎用影响行数做判断!!!

DataPipeline双料入选中国信通院2022数智化图谱、数据库发展报告

Small case of function transfer parameters

无密码身份验证如何保障用户隐私安全?

Solve Unicode decodeerror: 'GBK' codec can't decode byte 0xa2 in position 107

Android本地Sqlite数据库的备份和还原

Discussion on error messages and API versions of SAP ui5 getsaplogonlanguage is not a function

Alibaba cloud SLB load balancing product basic concept and purchase process
随机推荐
Word document injection (tracking word documents) incomplete
Halcon template matching actual code (I)
CF:A. The Third Three Number Problem【关于我是位运算垃圾这个事情】
155. Minimum stack
【每日一题】1200. 最小绝对差
Write macro with word
先写API文档还是先写代码?
将函数放在模块中
量价虽降,商业银行结构性存款为何受上市公司所偏爱?
Default parameters of function & multiple methods of function parameters
[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging
CloudCompare——点云切片
The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
Shu tianmeng map × Weiyan technology - Dream map database circle of friends + 1
Apicloud studio3 API management and debugging tutorial
It's too convenient. You can complete the code release and approval by nailing it!
ABAP editor in SAP segw transaction code
mysql econnreset_ Nodejs socket error handling error: read econnreset
Introduction to the principle of DNS
Laravel document reading notes -mews/captcha use (verification code function)