当前位置:网站首页>个人组件 - 消息提示
个人组件 - 消息提示
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>
边栏推荐
- C# 对象存储
- Rocky basics 1
- Laravel document reading notes -mews/captcha use (verification code function)
- 实现 1~number 之间,所有数字的加和
- JPA规范总结和整理
- 将函数放在模块中
- "Baidu Cup" CTF competition in September, web:sql
- Concurrent performance test of SAP Spartacus with JMeter
- SAP UI5 FlexibleColumnLayout 控件介绍
- MySQL 巨坑:update 更新慎用影响行数做判断!!!
猜你喜欢
How can non-technical departments participate in Devops?
聊聊异步编程的 7 种实现方式
Small case of function transfer parameters
Shu tianmeng map × Weiyan technology - Dream map database circle of friends + 1
[深度学习论文笔记]TransBTSV2: Wider Instead of Deeper Transformer for Medical Image Segmentation
简单上手的页面请求和解析案例
leetcode:221. 最大正方形【dp状态转移的精髓】
爱可生SQLe审核工具顺利完成信通院‘SQL质量管理平台分级能力’评测
使用 jMeter 对 SAP Spartacus 进行并发性能测试
Android本地Sqlite数据库的备份和还原
随机推荐
STM32 and motor development (from architecture diagram to documentation)
A detailed explanation of ASCII code, Unicode and UTF-8
百度杯”CTF比赛 2017 二月场,Web:爆破-2
Talking about fake demand from takeout order
国际自动机工程师学会(SAE International)战略投资几何伙伴
Hiengine: comparable to the local cloud native memory database engine
Hiengine: comparable to the local cloud native memory database engine
Concurrent performance test of SAP Spartacus with JMeter
Notion 类笔记软件如何选择?Notion 、FlowUs 、Wolai 对比评测
Lb10s-asemi rectifier bridge lb10s
155. 最小栈
[cloud native] use of Nacos taskmanager task management
Rocky basic command 3
将函数放在模块中
【服务器数据恢复】某品牌服务器存储raid5数据恢复案例
Detailed explanation of navigation component of openharmony application development
简单上手的页面请求和解析案例
函数传递参数小案例
量价虽降,商业银行结构性存款为何受上市公司所偏爱?
Changing JS code has no effect