From 711c8d1aff02475c7d5bb287ab9f156a578d8b4a Mon Sep 17 00:00:00 2001 From: Book Pauk Date: Sun, 13 Jan 2019 02:51:19 +0700 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BA=D0=BE=D0=BC=D0=BF=D0=BE=D0=BD=D0=B5=D0=BD=D1=82=20Messag?= =?UTF-8?q?eBox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/Reader/LoaderPage/LoaderPage.vue | 6 ++---- client/element.js | 16 ++++++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/client/components/Reader/LoaderPage/LoaderPage.vue b/client/components/Reader/LoaderPage/LoaderPage.vue index fa30b5d5..2352c9a1 100644 --- a/client/components/Reader/LoaderPage/LoaderPage.vue +++ b/client/components/Reader/LoaderPage/LoaderPage.vue @@ -13,7 +13,6 @@ Загрузить файл с диска -
{{ loadState }}
Комментарии @@ -34,7 +33,6 @@ export default @Component({ }) class LoaderPage extends Vue { bookUrl = null; - loadState = null; created() { this.commit = this.$store.commit; @@ -59,7 +57,7 @@ class LoaderPage extends Vue { async submitUrl() { if (this.bookUrl) { - const loading = this.$loading({ target: this.$refs.main, customClass: 'loading'}); + const loading = this.$loading({target: this.$refs.main, customClass: 'loading'}); try { const book = await readerApi.loadBook(this.bookUrl, (state) => { const progress = state.progress || 0; @@ -67,8 +65,8 @@ class LoaderPage extends Vue { }); loading.close(); } catch (e) { - this.loadState = e.message; loading.close(); + this.$alert(e.message, 'Ошибка', {type: 'error'}); } } } diff --git a/client/element.js b/client/element.js index 91e4a602..69c2e085 100644 --- a/client/element.js +++ b/client/element.js @@ -56,6 +56,9 @@ import './theme/notification.css'; import Loading from 'element-ui/lib/loading'; import './theme/loading.css'; +import MessageBox from 'element-ui/lib/message-box'; +import './theme/message-box.css'; + const components = { ElMenu, ElMenuItem, ElButton, ElCheckbox, ElTabs, ElTabPane, ElTooltip, ElContainer, ElAside, ElMain, ElHeader, @@ -69,12 +72,13 @@ for (let [name, comp] of Object.entries(components)) { //Vue.use(Loading.directive); Vue.prototype.$loading = Loading.service; -//Vue.prototype.$msgbox = MessageBox; -//Vue.prototype.$alert = MessageBox.alert; -//Vue.prototype.$confirm = MessageBox.confirm; -//Vue.prototype.$prompt = MessageBox.prompt; +Vue.prototype.$msgbox = MessageBox; +Vue.prototype.$alert = MessageBox.alert; +Vue.prototype.$confirm = MessageBox.confirm; +Vue.prototype.$prompt = MessageBox.prompt; Vue.prototype.$notify = Notification; //Vue.prototype.$message = Message; -import locale from 'element-ui/lib/locale/lang/ru-RU'; -Vue.prototype.$ELEMENT = { locale }; +import lang from 'element-ui/lib/locale/lang/ru-RU'; +import locale from 'element-ui/lib/locale'; +locale.use(lang);