Skip to content

Using a bootfile inside a bootfile #9097

Discussion options

You must be logged in to vote

@bernhardh try:

// boot/notify.js
import { Notify } from 'quasar'

const notify = {
    msg(title, msg, type) {
      Notify.create({
        message: title + (msg ? '<div class="text-caption">' + msg + '</div>' : ''),
        type: type || "error",
        html: true
      })
    }
  }

export default async ({ app }) => {
  app.config.globalProperties.$notify = notify
}

export { notify } // <--- notice the export

// boot/axios.js
import { notify } from 'boot/notify'
...
api.interceptors.response.use((response) => response, (error) => {
    notify.msg("An error occured", error.message);
});
...

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@bernhardh
Comment options

@bernhardh
Comment options

@metalsadman
Comment options

Answer selected by rstoenescu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants