当前位置:网站首页>Personal component - message prompt
Personal component - message prompt
2022-07-05 13:27:00 【Rotten Bobby】
<script lang="ts" setup name="XtxMessage">
import {
PropType } from 'vue'
defineProps({
type: {
type: String as PropType<'success' | 'error' | 'warning'>,
default: 'success',
},
})
// Define an object , A style that contains three cases , object key Is the type string
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>
边栏推荐
- stm32逆向入门
- How to realize batch sending when fishing
- Don't know these four caching modes, dare you say you understand caching?
- 49. 字母异位词分组:给你一个字符串数组,请你将 字母异位词 组合在一起。可以按任意顺序返回结果列表。 字母异位词 是由重新排列源单词的字母得到的一个新单词,所有源单词中的字母通常恰好只用一次。
- 山东大学暑期实训一20220620
- 量价虽降,商业银行结构性存款为何受上市公司所偏爱?
- go 数组与切片
- JS to determine whether an element exists in the array (four methods)
- mysql econnreset_ Nodejs socket error handling error: read econnreset
- Reverse Polish notation
猜你喜欢
Record in-depth learning - some bug handling
UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xe6 in position 76131: invalid continuation byt
How to protect user privacy without password authentication?
Cf:a. the third three number problem
Nantong online communication group
法国学者:最优传输理论下对抗攻击可解释性探讨
FPGA learning notes: vivado 2019.1 add IP MicroBlaze
Pycharm installation third party library diagram
[deep learning paper notes] hnf-netv2 for segmentation of brain tumors using multimodal MR imaging
jenkins安装
随机推荐
【每日一题】1200. 最小绝对差
Reverse Polish notation
Multi person cooperation project to see how many lines of code each person has written
面试官灵魂拷问:为什么代码规范要求 SQL 语句不要过多的 join?
Could not set property ‘id‘ of ‘class XX‘ with value ‘XX‘ argument type mismatch 解决办法
What are the private addresses
Write API documents first or code first?
go 字符串操作
go map
运筹说 第68期|2022年最新影响因子正式发布 快看管科领域期刊的变化
[notes of in-depth study paper]uctransnet: rethink the jumping connection in u-net from the perspective of transformer channel
Backup and restore of Android local SQLite database
4年工作经验,多线程间的5种通信方式都说不出来,你敢信?
[notes of in-depth study paper]transbtsv2: wider instead of deep transformer for medical image segmentation
个人组件 - 消息提示
MMSeg——Mutli-view时序数据检查与可视化
Record in-depth learning - some bug handling
Rocky基础命令3
Shuttle INKWELL & ink components
Cloudcompare - point cloud slice