diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-11-14 16:30:58 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-11-14 16:30:58 +0900 |
| commit | 11afa8140c5706c8ad105e50cef63df83db66e7a (patch) | |
| tree | d7e322dab3dc20f9ba86681dd7b2354af922fdda /src/client/app/init.ts | |
| parent | [Client] Add missing icons (diff) | |
| download | sharkey-11afa8140c5706c8ad105e50cef63df83db66e7a.tar.gz sharkey-11afa8140c5706c8ad105e50cef63df83db66e7a.tar.bz2 sharkey-11afa8140c5706c8ad105e50cef63df83db66e7a.zip | |
[Client] Improve alert component
Diffstat (limited to 'src/client/app/init.ts')
| -rw-r--r-- | src/client/app/init.ts | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/client/app/init.ts b/src/client/app/init.ts index d1ac060564..60f4ab31fe 100644 --- a/src/client/app/init.ts +++ b/src/client/app/init.ts @@ -7,7 +7,6 @@ import Vuex from 'vuex'; import VueRouter from 'vue-router'; import VAnimateCss from 'v-animate-css'; import VModal from 'vue-js-modal'; -import VueSweetalert2 from 'vue-sweetalert2'; import VueI18n from 'vue-i18n'; import VueHotkey from './common/hotkey'; @@ -16,6 +15,7 @@ import checkForUpdate from './common/scripts/check-for-update'; import MiOS from './mios'; import { clientVersion as version, codename, lang } from './config'; import { builtinThemes, lightTheme, applyTheme } from './theme'; +import Alert from './common/views/components/alert.vue'; if (localStorage.getItem('theme') == null) { applyTheme(lightTheme); @@ -258,7 +258,6 @@ Vue.use(VueRouter); Vue.use(VAnimateCss); Vue.use(VModal); Vue.use(VueHotkey); -Vue.use(VueSweetalert2); Vue.use(VueI18n); Vue.component('fa', FontAwesomeIcon); @@ -430,6 +429,13 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS]) => void, document.body.appendChild(x.$el); return x; }, + alert(opts) { + return new Promise((res) => { + const vm = this.new(Alert, opts); + vm.$once('ok', () => res(true)); + vm.$once('cancel', () => res(false)); + }); + } }, router, render: createEl => createEl(App) |