liveh5-nuxt/app/components/x-message/message/index.vue
xingyy 525cec428f feat(layout): 重构首页布局并添加新功能
- 重写首页模板,使用新的拍卖列表组件
- 添加下拉刷新和加载更多功能
- 新增拍卖说明页面
- 使用自定义图标替换默认图标
- 优化消息提示组件
2025-01-09 19:01:35 +08:00

55 lines
1.1 KiB
Vue

<script setup>
import error from '../images/error.png'
import success from '../images/success.png'
import warning from '../images/warning.png'
const props = defineProps({
type: {
type: String,
default: 'success',
validator: (value) => ['success', 'error', 'warning'].includes(value)
},
text: {
type: String,
default: ''
}
})
const typeConfig = {
success: {
imgSrc: success,
borderColor: '#C5E7D5',
bgColor: '#EDF7F2'
},
error: {
imgSrc: error,
borderColor: '#F3CBD3',
bgColor: '#FBEEF1'
},
warning: {
imgSrc: warning,
borderColor: '#FAE0B5',
bgColor: '#FEF7ED'
}
}
</script>
<template>
<div
class="box-border w-[343px] min-h-[46px] rounded-[4px] border flex items-center px-[15px] shadow-sm"
:style="{
borderColor: typeConfig[type].borderColor,
backgroundColor: typeConfig[type].bgColor
}"
>
<div class="w-[20px] h-[20px] mr-[9px]">
<img
:src="typeConfig[type].imgSrc"
class="w-full h-full"
alt=""
>
</div>
<div class="text-[14px] leading-normal text-black">{{ text }}</div>
</div>
</template>