当前位置:网站首页>个人组件 - 消息提示
个人组件 - 消息提示
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>
边栏推荐
- Rocky基础知识1
- Talk about my drawing skills in my writing career
- 精彩速递|腾讯云数据库6月刊
- 时钟周期
- 同事半个月都没搞懂selenium,我半个小时就给他整明白!顺手秀了一波爬淘宝的操作[通俗易懂]
- Difference between avc1 and H264
- LB10S-ASEMI整流桥LB10S
- 阿里云SLB负载均衡产品基本概念与购买流程
- Overflow toolbar control in SAP ui5 view
- Default parameters of function & multiple methods of function parameters
猜你喜欢

“百度杯”CTF比赛 九月场,Web:SQL

先写API文档还是先写代码?

Pandora IOT development board learning (HAL Library) - Experiment 7 window watchdog experiment (learning notes)

Talk about my drawing skills in my writing career

leetcode:221. 最大正方形【dp状态转移的精髓】

STM32 and motor development (from architecture diagram to documentation)
![[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging](/img/52/5e85743b1817de96a52e02b92fd08c.png)
[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging

Developers, is cloud native database the future?

LB10S-ASEMI整流桥LB10S

量价虽降,商业银行结构性存款为何受上市公司所偏爱?
随机推荐
数据泄露怎么办?'华生·K'7招消灭安全威胁
Get you started with Apache pseudo static configuration
Flutter InkWell & Ink组件
[深度学习论文笔记]TransBTSV2: Wider Instead of Deeper Transformer for Medical Image Segmentation
CF:A. The Third Three Number Problem【关于我是位运算垃圾这个事情】
SAP UI5 FlexibleColumnLayout 控件介绍
Detailed explanation of navigation component of openharmony application development
I'm doing open source in Didi
JPA规范总结和整理
The solution of outputting 64 bits from printf format%lld of cross platform (32bit and 64bit)
Android本地Sqlite数据库的备份和还原
精彩速递|腾讯云数据库6月刊
##无监控,不运维,以下是监控里常用的脚本监控
聊聊异步编程的 7 种实现方式
一文详解ASCII码,Unicode与utf-8
将函数放在模块中
OpenHarmony应用开发之Navigation组件详解
155. 最小栈
js判断数组中是否存在某个元素(四种方法)
FPGA 学习笔记:Vivado 2019.1 添加 IP MicroBlaze