refactor(sse): 重构 SSE 分层并同步调整通知中心与示例页
- src/composables/sse: 删除,连接实现下沉到 utils/sse,事件名枚举迁到 enums/sse - src/utils/sse: 新增 SSE 连接与事件订阅实现 - src/stores/dict: 改用 utils/sse 订阅字典变更 - src/stores/user: 登出清理改用 utils/sse 的 cleanupSse - src/views/dashboard: 在线用户订阅下沉为页面级 composable - src/components/NoticeCenter: 由 NoticeDropdown 改名 - src/views/demo: 示例页面按 component/route/table 归类 - src/router: 同步示例详情页路由路径
This commit is contained in:
1 parent
d36ccf54d5
commit
d136266acd
47 files changed
+207
-430
No files matched your search
@@ -0,0 +1,26 @@
|
||||
<!-- 图标选择器示例 -->
|
||||
<template>
|
||||
<div class="page-container">
|
||||
<el-link
|
||||
href="https://gitee.com/youlaiorg/vue3-element-admin/blob/master/src/views/demo/component/icon-select.vue"
|
||||
type="primary"
|
||||
target="_blank"
|
||||
class="mb-10"
|
||||
>
|
||||
示例源码 请点击>>>
|
||||
</el-link>
|
||||
<IconSelect v-model="iconName" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// ❌ 踩坑:页面文件名 icon-select.vue 与模板标签 <icon-select> 同名会触发 Vue 隐式自引用
|
||||
// (unplugin-vue-components 对同名组件禁用自动导入,运行时解析到页面自身 → 无限递归栈溢出白屏)
|
||||
// ✅ 显式导入公共组件,优先级高于隐式自引用,杜绝递归
|
||||
import IconSelect from "@/components/IconSelect/index.vue";
|
||||
|
||||
// element-plus 图标格式以el-icon-开头
|
||||
const iconName = ref("el-icon-edit");
|
||||
// 本地SVG图标格式为src/assets/icons 下的文件名,不需要svg后缀
|
||||
// const iconName = ref("api");
|
||||
</script>
|
||||
Reference in new issue
Block a user