mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +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 {
|
||||||
const elem = document.querySelector(selector)
|
try {
|
||||||
if (elem) {
|
const elem = document.querySelector(selector)
|
||||||
return parseFloat(getComputedStyle(elem).scrollMarginTop)
|
if (elem) {
|
||||||
}
|
return parseFloat(getComputedStyle(elem).scrollMarginTop)
|
||||||
|
}
|
||||||
|
} catch {}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user