Skip to content

@nuxtjs/toast - How to pass options to globally configured toast module #357

Open
@racode246

Description

@racode246

How to pass options to globally configured toast module?
I could pass the message but not the options.

In my nuxt file I have:

  toast: {
    position: 'top-center',
    register: [
      {
        name: 'error',
        message: (payload: any) => payload.message,
        options: {
          type: 'error',
          icon: 'error',
          className: 'toastCustom--error',
          position: (payload: any) =>
            payload.position ? payload.position : 'top-center',
          duration: 5000
        }
      }
    ]
  }

and passed the option like this

this.$toast.global.error({ message: 'test' }, { position: 'bottom-center' })

What should I do?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions