mirror of
https://github.com/jerryc127/hexo-theme-butterfly.git
synced 2026-04-08 12:07:06 +08:00
fix(Pjax): 增加错误处理以防止Pjax失效
This commit is contained in:
8
layout/includes/third-party/pjax.pug
vendored
8
layout/includes/third-party/pjax.pug
vendored
@@ -29,7 +29,13 @@ script.
|
||||
|
||||
const triggerPjaxFn = (val) => {
|
||||
if (!val) return
|
||||
Object.values(val).forEach(fn => fn())
|
||||
Object.values(val).forEach(fn => {
|
||||
try {
|
||||
fn()
|
||||
} catch (err) {
|
||||
console.debug('Pjax callback failed:', err)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
document.addEventListener('pjax:send', () => {
|
||||
|
||||
Reference in New Issue
Block a user