-
Notifications
You must be signed in to change notification settings - Fork 84
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
原生JS实现hash路由 #119
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
实现原理
在Javascript中有一个API,可以监听当前浏览器地址中hash的变化(即地址上#后面的部分),利用这一特点,当我们通过某些按钮改变地址的hash时,可以针对性地做出某些改变,这就是hash理由的主要实现原理
在线demo
具体的实现代码
The text was updated successfully, but these errors were encountered: