update for issue/bug #100
This commit is contained in:
parent
c1abf5f07c
commit
3d1b4f0ee2
4 changed files with 12 additions and 6 deletions
|
|
@ -184,6 +184,7 @@ See the [CHANGELOG](CHANGELOG.md) file for details.
|
|||
* [Nicholas La Roux](https://github.com/larouxn)
|
||||
* [RifqiAlAbqary](https://github.com/reefqi037)
|
||||
* [izerozlu](https://github.com/izerozlu)
|
||||
* [Nilesh Patel](https://github.com/NileshSP)
|
||||
|
||||
### Thanks
|
||||
* [Dribbble](https://dribbble.com)
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
# MIDDLEWARE
|
||||
|
||||
**This directory is not required, you can delete it if you don't want to use it.**
|
||||
|
||||
This directory contains your application middleware.
|
||||
Middleware let you define custom functions that can be run before rendering either a page or a group of pages.
|
||||
<br/>
|
||||
parsedefaulturl.js - parse default url for appropriate path
|
||||
<br/>
|
||||
<br/>
|
||||
|
||||
More information about the usage of this directory in [the documentation](https://nuxtjs.org/guide/routing#middleware).
|
||||
|
|
|
|||
5
middleware/parsedefaulturl.js
Normal file
5
middleware/parsedefaulturl.js
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
export default function({ route, redirect }) {
|
||||
if(route.fullPath !== '/') {
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
|
|
@ -243,7 +243,8 @@
|
|||
export const findStatusGroup = responseStatus => statusCategories.find(status => status.statusCodeRegex.test(responseStatus));
|
||||
|
||||
export default {
|
||||
directives: {
|
||||
middleware: 'parsedefaulturl', // calls middleware before loading the page
|
||||
directives: {
|
||||
textareaAutoHeight
|
||||
},
|
||||
components: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue