Files
asco_admin/src/notify.js
T

38 lines
1004 B
JavaScript
Raw Normal View History

2021-01-09 20:53:13 +03:30
export default {
install(Vue, options) {
// 4. add an instance method
Vue.prototype.$ntSetError = function (msg) {
this.$vs.notify({
title: 'خطا در ثبت اطلاعات',
2021-03-14 09:40:47 +03:30
//text: msg || 'اطلاعات ثبت نگردید.',
2021-01-09 20:53:13 +03:30
color: 'danger',
})
}
Vue.prototype.$ntSet = function (msg) {
this.$vs.notify({
2021-03-14 09:40:47 +03:30
//title: 'اطلاعات ثبت شد.',
2021-01-09 20:53:13 +03:30
text: msg || 'اطلاعات با موفقیت به ثبت رسید',
color: 'primary',
})
}
Vue.prototype.$ntRemove = function (msg) {
this.$vs.notify({
title: 'اطلاعات با موفقیت حذف شد',
text: msg || '',
color: 'warning',
})
}
Vue.prototype.$ntGetError = function (msg) {
this.$vs.notify({
title: 'خطا در ثبت اطلاعات',
text: msg || 'در اطلاعات دریافت شده خطایی رخ داده ',
color: 'danger',
})
}
}
};