How to use the buefy/dist/components/toast.Toast.open function in buefy

To help you get started, we’ve selected a few buefy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github projeto-spider / labes-2019 / middleware / auth.js View on Github external
export default function({ store, error, redirect, route }) {
  if (!store.state.auth.user) {
    redirect('/login')
  }
  if (
    !route.path.includes('teacher') &&
    store.state.auth.user.role === 'teacher'
  ) {
    Toast.open('Usuario nao autorizado')
    redirect('/login')
  }
}
github projeto-spider / labes-2019 / middleware / course.js View on Github external
export default function({ store, redirect }) {
  if (!store.state.courseTag) {
    const currentUser = store.state.auth.user
    Toast.open('Selecione um Curso')
    if (currentUser.role === 'admin') {
      redirect('/')
    } else if (currentUser.role === 'teacher') {
      redirect('/teacher/home')
    }
  }
}
github projeto-spider / labes-2019 / plugins / axios.js View on Github external
$axios.onError(error => {
    const code = parseInt(error.response && error.response.status)
    if (
      code === 400 &&
      error.response.data.code === process.env.errors.INVALID_TOKEN
    ) {
      Toast.open({
        type: 'is-danger',
        message: 'Login expirado',
        duration: 5000
      })
      store.dispatch('auth/logout')
      redirect('/login')
    } else if (error.message === 'Network Error') {
      Toast.open({
        type: 'is-danger',
        message: 'Ocorreu um erro na conexão'
      })
    } else {
      throw error
    }
  })
}