添加文档注释,方便生成技术文档
This commit is contained in:
+12
-1
@@ -1,8 +1,15 @@
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
/**
|
||||
* 首页导航相关钩子函数
|
||||
* @returns 顶部导航映射和激活状态判断函数
|
||||
*/
|
||||
export const useIndex = () => {
|
||||
const route = useRoute();
|
||||
|
||||
/**
|
||||
* 顶部导航映射配置
|
||||
*/
|
||||
const topNavMap = [
|
||||
{ title: '暴雨灾害链', name: 'rainstorm', query: { identification: 1 } },
|
||||
{ title: '地震灾害链', name: 'earthquake', query: { identification: 2 } },
|
||||
@@ -12,7 +19,11 @@ export const useIndex = () => {
|
||||
{ title: '文件管理', name: 'index', query: { identification: 6 } },
|
||||
];
|
||||
|
||||
// 判断当前导航项是否激活
|
||||
/**
|
||||
* 判断当前导航项是否激活
|
||||
* @param identification - 导航项标识
|
||||
* @returns 是否为激活状态
|
||||
*/
|
||||
const isActive = (identification: number) => {
|
||||
const targetId = identification.toString();
|
||||
let currentId = route.query.identification;
|
||||
|
||||
Reference in New Issue
Block a user