mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-17 08:14:25 +08:00
code refactor
This commit is contained in:
+29
-1
@@ -31,7 +31,35 @@ Vue.prototype.$setLanguage = function (locale) {
|
||||
axios.defaults.headers.common['Accept-Language'] = locale;
|
||||
document.querySelector('html').setAttribute('lang', locale);
|
||||
return locale;
|
||||
}
|
||||
};
|
||||
Vue.prototype.$alert = function (message, confirmCallback) {
|
||||
this.$f7.dialog.create({
|
||||
title: i18n.t('global.app.title'),
|
||||
text: i18n.t(message),
|
||||
buttons: [
|
||||
{
|
||||
text: i18n.t('OK'),
|
||||
onClick: confirmCallback
|
||||
}
|
||||
]
|
||||
}).open();
|
||||
};
|
||||
Vue.prototype.$confirm = function (message, confirmCallback, cancelCallback) {
|
||||
this.$f7.dialog.create({
|
||||
title: i18n.t('global.app.title'),
|
||||
text: i18n.t(message),
|
||||
buttons: [
|
||||
{
|
||||
text: i18n.t('Cancel'),
|
||||
onClick: cancelCallback
|
||||
},
|
||||
{
|
||||
text: i18n.t('OK'),
|
||||
onClick: confirmCallback
|
||||
}
|
||||
]
|
||||
}).open();
|
||||
};
|
||||
Vue.prototype.$services = services;
|
||||
Vue.prototype.$user = userstate;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user