Nuxt.js: Default page

Created on 29 Apr 2019  路  5Comments  路  Source: nuxt/nuxt.js

What problem does this feature solve?

Currently I'm extending nuxt by adding custom routes.

this.extendRoutes((routes, resolve) => {
   routes.push({
     name: 'index',
     path: '',
     component: resolve(__dirname, 'pages, index.vue')
   });
})

The problem is that I have no default pages folder within my nuxt solution using this custom module. As a result, nuxt overwrites my default page. I can solve this by adding an empty pages folder but it would be cleaner if there was an option to skip the default generate page step.

What does the proposed changes look like?

I propose to add an option which overwrites the _defaultPage property (https://github.com/nuxt/nuxt.js/blob/dev/packages/builder/src/builder.js#L188)

this._defaultPage = this.options.skipDefaultPage || true; 
This feature request is available on Nuxt community (#c9128)
feature-request good first issue

All 5 comments

Feel free to create a PR 鈽猴笍

Sure, will pick this up!

Hi. Please see https://github.com/nuxt-community/router-module

Aha, thanks, exactly what I was looking for. Not sure if it's still necessary to create a pull request? What do you all think?

@dietergoetelen No problems :) If it works fine for you i think not. Please report any problems if you encounter.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nassimbenkirane picture nassimbenkirane  路  3Comments

lazycrazy picture lazycrazy  路  3Comments

o-alexandrov picture o-alexandrov  路  3Comments

bimohxh picture bimohxh  路  3Comments

jaredreich picture jaredreich  路  3Comments