当前位置:网站首页>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>
边栏推荐
- 碎片化知识管理工具Memos
- 量价虽降,商业银行结构性存款为何受上市公司所偏爱?
- Go array and slice
- 华为推送服务内容,阅读笔记
- 爱可生SQLe审核工具顺利完成信通院‘SQL质量管理平台分级能力’评测
- MySQL get time
- With 4 years of working experience, you can't tell five ways of communication between multithreads. Dare you believe it?
- Parsing XML using Dom4j
- How to choose note taking software? Comparison and evaluation of notion, flowus and WOLAI
- Put functions in modules
猜你喜欢

Huawei push service content, read notes

龙芯派2代烧写PMON和重装系统

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

Asemi rectifier bridge hd06 parameters, hd06 pictures, hd06 applications

Although the volume and price fall, why are the structural deposits of commercial banks favored by listed companies?

STM32 reverse entry

CAN和CAN FD

Put functions in modules

MSTP and eth trunk

Flutter draws animation effects of wave movement, curves and line graphs
随机推荐
MySQL get time
4年工作经验,多线程间的5种通信方式都说不出来,你敢信?
一网打尽异步神器CompletableFuture
记录一下在深度学习-一些bug处理
MSTP and eth trunk
什么是网络端口
Could not set property ‘id‘ of ‘class XX‘ with value ‘XX‘ argument type mismatch 解决办法
Pycharm installation third party library diagram
What is a network port
js判断数组中是否存在某个元素(四种方法)
Navigation property and entityset usage in SAP segw transaction code
Default parameters of function & multiple methods of function parameters
Flutter InkWell & Ink组件
Can and can FD
Go array and slice
Don't know these four caching modes, dare you say you understand caching?
同事半个月都没搞懂selenium,我半个小时就给他整明白!顺手秀了一波爬淘宝的操作[通俗易懂]
leetcode:221. Maximum square [essence of DP state transition]
APICloud Studio3 API管理与调试使用教程
使用Dom4j解析XML