feat: Add support for hash-based routing tracking

This commit is contained in:
wuzhiqing 2024-10-28 02:01:46 +00:00
parent e881735a23
commit 3fb68e1684

View File

@ -53,8 +53,9 @@
const parseURL = url => { const parseURL = url => {
try { try {
const { pathname, search } = new URL(url); // use location.origin as the base to handle cases where the url is a relative path
url = pathname + search; const { pathname, search, hash } = new URL(url, location.origin);
url = pathname + search + hash;
} catch (e) { } catch (e) {
/* empty */ /* empty */
} }