Godofbrowser / vuejs-dialog

A lightweight, promise based alert, prompt and confirm dialog
351 stars 111 forks source link

No idea why #6

Closed SergeyMiracle closed 7 years ago

SergeyMiracle commented 7 years ago

Getting error when dialog window opens https://cl.ly/0w3M342g0K2E Also when click cancel there is message in console (false), how can it be disabled?

Godofbrowser commented 7 years ago

Hello @SergeyMiracle. This error might not be related to the plugin. Can you give more information that could help in recreating this error? like the way it was used, what browser it was used on, and what happened before the error occurred.

SergeyMiracle commented 7 years ago

Nothing special

import VuejsDialog from 'vuejs-dialog'

Vue.use(VuejsDialog, {
  html: true,
  loader: true,
  okText: 'Да, удалить!',
  cancelText: 'Нет, оставить',
  animation: 'bounce'
})

methods: {
  deleteItem: function (data) {
        this.$dialog.confirm('<div class="text-center"><h4 class="bold">Вы уверены?</h4> <small>После удаления восстановление не возможно!</small></div>').then(dialog => {
          this.$axios.delete(`crm/contacts/${data.id}`).then(() => {
            dialog.close()
            this.refreshData()
            window.toastr.success('Удаление прошло успешно!')
          }).catch(() => dialog.close())
        }).catch(e => console.log(e))
      }
}

Yandex browser

Error occurs when i call deleteItem method

Godofbrowser commented 7 years ago

@SergeyMiracle I'm sorry but in the meantime, i can't seem to be able to replicate this error. Used the same parameters and it works quite well. https://jsfiddle.net/godofbrowser/rmc4dkte/

SergeyMiracle commented 7 years ago

@Godofbrowser I tried to remove other plugins, but no luck.

SergeyMiracle commented 7 years ago

I guess it has to do something with vuex...

SergeyMiracle commented 7 years ago

Can not replicate this error in fiddle too. It seems has issue with other plugins, but can not found witch one.

SergeyMiracle commented 7 years ago

I found it... No idea why, but it has something with VueKindergarten plugin Was (errors)

Vue.use(VueKindergarten, {
  child: store => store.state.user.user
})

Now (working)

Vue.use(VueKindergarten, {
  child: store => {
    if (store) {
      return store.state.user.user
    }
  }
})
Godofbrowser commented 7 years ago

Glad you found the error. 😀