- Vite + Vue3 + Pinia + TypeScript + UnoCSS + TDesign 技术栈 - 左侧固定导航 + 暗黑/浅色主题 + PC/移动端响应式布局 - 14 个工具:图片压缩/裁剪、二维码、JSON、时间戳、Base64、 JWT、Cron、进制转换、哈希、身份证、地址解析、URL 解析、OCR - 本地历史记录(localStorage)与通用复制/下载/错误提示组件 - 所有文件处理均在浏览器本地完成,不上传服务器
33 lines
613 B
Vue
33 lines
613 B
Vue
<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>
|