mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
Update router.js
This commit is contained in:
parent
5f55bf76bd
commit
a89a0f7ca9
@ -56,8 +56,6 @@ const scrollBehavior = function (to, from, savedPosition) {
|
||||
if (to.hash) {
|
||||
let hash = to.hash
|
||||
// CSS.escape() is not supported with IE and Edge.
|
||||
// But we can use the following polyfill to solve this problem.
|
||||
// https://github.com/mathiasbynens/CSS.escape
|
||||
if (typeof window.CSS !== 'undefined' && typeof window.CSS.escape !== 'undefined') {
|
||||
hash = '#' + window.CSS.escape(hash.substr(1))
|
||||
}
|
||||
@ -67,7 +65,7 @@ const scrollBehavior = function (to, from, savedPosition) {
|
||||
position = { selector: hash }
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('failed to save the scroll position. possibly this problem can be solved using a polyfill for CSS.escape().')
|
||||
console.warn('Failed to save scroll position. Please add CSS.escape() polyfill (https://github.com/mathiasbynens/CSS.escape).')
|
||||
}
|
||||
}
|
||||
resolve(position)
|
||||
|
Loading…
Reference in New Issue
Block a user