Skip to content

Commit 279e17c

Browse files
committed
route
1 parent f54ed37 commit 279e17c

File tree

5 files changed

+11
-2
lines changed

5 files changed

+11
-2
lines changed

base/状态机.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# 状态机 state machine

路由/JS路由原理.md route/JS路由原理.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
原理:通过监听全局的`hashChange`事件,当url的hash改变时进行判断和匹配
2828

29-
![](./assets//hash%E8%B7%AF%E7%94%B1%E6%B5%81%E7%A8%8B.jpeg)
29+
![](./assets/hash_route.jpeg)
3030

3131
```ts
3232
// 监听hash的改变
@@ -51,4 +51,12 @@ location.hash = "#hash1";
5151
1. 改变url的hash值,不会触发页面的重新加载(load事件),会触发hashchange事件
5252

5353
# 三 history路由
54-
在保持url同源的情况下,改变url。
54+
在保持url同源的情况下,改变url。
55+
56+
![](./assets//history_route.jpeg)
57+
58+
59+
# 四 浏览器URL跳转原理
60+
61+
点击URL或前进后退,具体发生了什么
62+
![](./assets/after_url_transition.png)

route/assets/after_url_transition.png

156 KB
Loading
File renamed without changes.

route/assets/history_route.jpeg

42.5 KB
Loading

0 commit comments

Comments
 (0)