<script src="https://cdn.jsdelivr.net/gh/viivue/[email protected]/dist/easy-hash.min.js"></script>
We can use this library promptly after import it into your project
Usage | Description |
---|---|
EasyHash.add(hash) |
Add new hash to the URL and replace the current one if any (containing "#" or not are both acceptable) |
EasyHash.remove() |
Remove current hash value |
EasyHash.getHash() |
Get current hash |
EasyHash.on(eventName, callback) |
Assign events |
Name | Description |
---|---|
"change" |
After value changed |
EasyHash.on('change', () => {
// do something
})
// the same as window.addEventListener('hashchange',()=>{})
# Run dev server
npm run dev
# Build dev site
npm run build
# Generate production files
npm run prod
Copyright (c) 2023 ViiVue