tool.xpcool.com/src/components/common/ErrorAlert.vue
夏犀麟 e3c1534263 feat: 初始化纯前端在线工具站
- Vite + Vue3 + Pinia + TypeScript + UnoCSS + TDesign 技术栈
- 左侧固定导航 + 暗黑/浅色主题 + PC/移动端响应式布局
- 14 个工具:图片压缩/裁剪、二维码、JSON、时间戳、Base64、
  JWT、Cron、进制转换、哈希、身份证、地址解析、URL 解析、OCR
- 本地历史记录(localStorage)与通用复制/下载/错误提示组件
- 所有文件处理均在浏览器本地完成,不上传服务器
2026-08-21 12:15:33 +08:00

33 lines
613 B
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<t-alert
v-if="props.message"
class="error-alert"
theme="error"
:message="props.message"
close
@close="emit('close')"
/>
</template>
<script setup lang="ts">
/**
* 通用错误提示组件各工具页面校验失败时统一展示
* 通过 message 传入错误文本点击关闭或调用 clear 均可隐藏
*/
const props = defineProps<{
/** 错误信息为空时不渲染 */
message: string
}>()
const emit = defineEmits<{
/** 用户点击关闭按钮 */
close: []
}>()
</script>
<style scoped>
.error-alert {
margin-bottom: 12px;
}
</style>