[BUG] - Notiflix fonksiyonları içerisinde this datasına erişim hatası
orhanmusellim opened this issue · comments
Notiflix'e ait fonksiyonlar içerisinde vue instencesine this ile erişmem gerekirken this instencesi değişiyor ve erişemiyorum. Aşağıdaki şekilde bir çözüm ile sorunumu çözebiliyorum fakat her sefer bunu yapmak gerekiyor.
let vueData = this;
this.Notiflix.Confirm.Show('Uyarı', 'Kullanıcı Grubu Silinsin mi?', this.$i18n.t('tool.yes'), this.$i18n.t('tool.no'), function () {
vueData.$axios.post('personal/deleteGroup', {id: itemId}).then(response => {
if (response.data.status === "success") {
vueData.Notiflix.Notify.Success(response.data.message)
vueData.$store.dispatch('personals/getPersonalGroups')
} else {
vueData.Notiflix.Notify.Failure(response.data.message)
}
})
});
Merhaba.
this
, ait olduğu fonksiyonu temsil eder.
Üst level bir fonksiyona ait bir kavramı, bir iç fonksiyonda kullanmak istiyorsanız yukarıdaki örnekte olduğu üzere onu bir değişkene tanımlar, alt fonksiyonda öyle kullanırsınız.
Bu konunun, Notiflix veya Vue ile bir ilgisi bulunmuyor.
Teşekkürler.