mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-11-06 17:09:08 +08:00
- buyer(95) / seller(169) / im(53) / manager(280) 共 597 个组件全部从 Options API 转换为 <script setup> - 四端 vuex 全部移除,状态管理统一迁移至 pinia 4(stores/ 目录) - util.js 等基础设施去除 vm 首参依赖;全局属性($Message/$filters 等)在 script 内改为具名导入 - 被外部 ref 访问的公共组件均已补齐 defineExpose(清单见各端 MIGRATION-VUE3.md) - 各端 eslint 启用 vue/component-api-style 防止新代码回退 Options API - 四端 yarn build 全部通过;迁移约定与注意事项已更新至各端 MIGRATION-VUE3.md
42 lines
859 B
Vue
42 lines
859 B
Vue
<template>
|
|
<div @click="showMessage" class="message-con">
|
|
<el-tooltip
|
|
:visible="value > 0 ? undefined : false"
|
|
:content="value > 0 ? '有' + value + message : '无未读消息'"
|
|
placement="bottom"
|
|
>
|
|
<el-badge :value="value" :hidden="value <= 0" is-dot>
|
|
<el-icon :size="22"><Bell /></el-icon>
|
|
</el-badge>
|
|
</el-tooltip>
|
|
</div>
|
|
</template>
|
|
|
|
<script setup>
|
|
import { useRouter } from "vue-router";
|
|
import { Bell } from "@element-plus/icons-vue";
|
|
import util from "@/libs/util.js";
|
|
|
|
defineOptions({ name: "messageTip" });
|
|
|
|
const props = defineProps({
|
|
value: {
|
|
type: Number,
|
|
default: 0,
|
|
},
|
|
message: {
|
|
type: String,
|
|
default: "",
|
|
},
|
|
});
|
|
|
|
const router = useRouter();
|
|
|
|
function showMessage() {
|
|
util.openNewPage("message_index");
|
|
router.push({
|
|
name: "message_index",
|
|
});
|
|
}
|
|
</script>
|