Giter Site home page Giter Site logo

Comments (5)

danielroe avatar danielroe commented on May 12, 2024

The error page isn't a page/route and it is displayed no matter what page/route you are on. It does not support definePageMeta.

What are you trying to achieve?

from nuxt.js.

jd-solanki avatar jd-solanki commented on May 12, 2024

I'm building admin template and levaraging error.vue as my 404 page mainly. In my admin template, I have several route meta that allows you to customize the each route:

View my projects' route metas
Name Description Type
action? CASL action for the route string
subject? CASL subject for the route string
layoutWrapperClasses? Adds class to the layout wrapper div string
navActiveLink? Allow highlighting link which is not the active link in the navigation menu of the admin RouteLocationRaw
layout? 'blank' | 'default' - you are aware of it string
redirectIfLoggedIn? Redirect the user to the home page if this boolean is true (login & register pages) boolean

ATM, I want to:

  1. set layout to blank for 404 page (I can wrap the page with NuxtLayout as per docs as a workaround)
  2. set action for access control
  3. set subject for access control

According to best of my knowledge nuxt uses error.vue for 404 page, right?

from nuxt.js.

danielroe avatar danielroe commented on May 12, 2024

Yes, error.vue is used for displaying errors. Like app.vue, it's global and not specific to any page/route.

from nuxt.js.

pitambar-jha avatar pitambar-jha commented on May 12, 2024

You can trap the relevant route meta in a plugin and raise an error manually in case the route meta is β€˜blank’, It will open the 404 page automatically.

from nuxt.js.

jd-solanki avatar jd-solanki commented on May 12, 2024

Coming from Vue, I thought of error.vue as a page but it's something else in nuxt. Closing this as this is how nuxt behaves.

from nuxt.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.