mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 21:55:11 +00:00
fix(nuxt): swallow issues with query selectors (#8843)
This commit is contained in:
parent
14307d1327
commit
453ce78300
@ -48,10 +48,12 @@ export default <RouterConfig> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function _getHashElementScrollMarginTop (selector: string): number {
|
function _getHashElementScrollMarginTop (selector: string): number {
|
||||||
|
try {
|
||||||
const elem = document.querySelector(selector)
|
const elem = document.querySelector(selector)
|
||||||
if (elem) {
|
if (elem) {
|
||||||
return parseFloat(getComputedStyle(elem).scrollMarginTop)
|
return parseFloat(getComputedStyle(elem).scrollMarginTop)
|
||||||
}
|
}
|
||||||
|
} catch {}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user