Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: 增加部分注释 #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

HarryG55
Copy link
Member

No description provided.

@@ -6,7 +6,13 @@ import { ReactNode, createContext, useContext, useState } from "react";
* @since 0.1.0
* @version 1.0.0
*/
function combine(paths: readonly any[]): string {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你破坏了原有的注释

src/Components/Router.tsx Show resolved Hide resolved
src/Components/Router.tsx Show resolved Hide resolved
src/Components/Router.tsx Show resolved Hide resolved
src/Components/Router.tsx Show resolved Hide resolved
@@ -46,26 +56,35 @@ export function useRouter() {
}

/**
* 根据路径解析路由并刷新组件
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有直接刷新组件的操作,都是间接影响

history.replaceState(null, "", path);
update(path);
}

/**
* 重载页面:访问Reload路径后,访问目标路径
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

访问Reload的目的是完全卸载页面呈现的组件

if (target) {
// 禁止外部网站跳转
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊?

e.preventDefault();
// 刷新组件并压栈
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?导航到新页面?

useMount(() => {
// ?/路径数据清除
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?/是怎么来的,为什么要清除,清除后又做了什么?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants