fix(Pjax): 增加错误处理以防止Pjax失效

This commit is contained in:
DeepChirp
2025-09-05 23:43:14 +08:00
parent fcd760011a
commit c61f55a773

View File

@@ -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', () => {