Skip to content

LookinGit/nuxt-custom-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Example extend Nuxt error

Use

  • Create exception.js in plugins directory (see exception.js)
  • Add @/plugins/exception into plugins array of nuxt.config.js
  • Use app.$exception function instead of error function in asyncData

Example: pages/index.vue

export default {
    async asyncData({ app }) {
        try {
            const asyncData = {}
            asyncData.posts = await app.$axios.$get('/posts')

            return asyncData
        } catch(e) {
            app.$exception(e)
        }
    }
}

More docs about Nuxt error

About

Example extend Nuxt error function through plugins

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published