feat: add link for individual props/events/slots/configs/icons

This commit is contained in:
Justineo
2021-10-20 01:11:27 +08:00
parent df2b6892d2
commit b0dcdbb873
162 changed files with 2176 additions and 2073 deletions

27
plugins/target.js Normal file
View File

@@ -0,0 +1,27 @@
export default ({ app }) => {
let target
document.documentElement.addEventListener('click', () => {
if (!target) {
return
}
delete target.dataset.target
})
app.router.afterEach(to => {
if (!to.hash) {
return
}
setTimeout(() => {
const selector = decodeURIComponent(to.hash)
const anchor = document.querySelector(selector)
if (anchor.tagName === 'CODE') {
target = anchor.closest('tr')
target.dataset.target = ''
}
}, 0)
})
}