barbajs状态码:500无法读取未定义的属性“操作”

时间:2019-11-19 07:01:12

标签: javascript barbajs

萨拉姆

Barba运行正常,我正在使用barba core@2.8.0。但是在服务器上的状态码:500上我出错了

Cannot read property 'action' of undefined
at n.i.getAction

Video

您可以签出video here

这是我的代码

barba.init({

    requestError: (trigger, action, url, response) => {
        debugger
        // go to a custom 404 page if the user click on a link that return a 404 response status
        if (action === 'click' && response.status && response.status === 404) {
            barba.go('/404');
        }

        // prevent Barba from redirecting the user to the requested URL
        // this is equivalent to e.preventDefault()
        return false;
    },

    cacheIgnore: true,
    prefetchIgnore: true,
    timeout: 30000,
    transitions: [
        {
            //sync: true,
            // css classes will look like `.fade-xxx-[-xxx]`
            name: 'fade',
            before({ current, next, trigger }) {



            },
            leave({ current, next, trigger }) {



            },
            afterLeave({ current, next, trigger }) {


            },
            beforeEnter({ current, next, trigger }) {


            },
            enter({ current, next, trigger }) {

            },
            after({ current, next, trigger }) {


            }
        }
    ]
})

这是我用来初始化的代码。服务器上的500个错误代码会一直运行到afterleave,但不会在我前面提到的异常之后运行。

0 个答案:

没有答案