单页或布局上的中间件属性按预期工作。
但是当我尝试使用nuxt.config.js为每个页面定义中间件时,中间件不会被执行。运用
nuxt.config.js
{ router: { middleware: 'foo'} }
中间件必须是数组
{ router: { middleware: ['foo']} }