diff --git a/src/client/init.ts b/src/client/init.ts index 50f47080bb..9081238af2 100644 --- a/src/client/init.ts +++ b/src/client/init.ts @@ -13,6 +13,7 @@ import { deserialize } from '@syuilo/aiscript/built/serializer'; import VueHotkey from './scripts/hotkey'; import Root from './root.vue'; import MiOS from './mios'; +import widgets from './widgets'; import { version, langs, getLocale } from './config'; import { store } from './store'; import { router } from './router'; @@ -46,21 +47,10 @@ app.use(VAnimateCss); app.use(i18n); app.component('fa', FontAwesomeIcon); -require('./directives'); -require('./components'); -require('./widgets'); +widgets(app); -app.mixin({ - methods: { - destroyDom() { - this.$destroy(); - - if (this.$el.parentNode) { - this.$el.parentNode.removeChild(this.$el); - } - } - } -}); +//require('./directives'); +//require('./components'); console.info(`Misskey v${version}`); diff --git a/src/client/widgets/index.ts b/src/client/widgets/index.ts index 2d27d27e58..1e6d4fe121 100644 --- a/src/client/widgets/index.ts +++ b/src/client/widgets/index.ts @@ -1,16 +1,18 @@ -import Vue from 'vue'; +import { App } from 'vue'; -Vue.component('mkw-welcome', () => import('./welcome.vue').then(m => m.default)); -Vue.component('mkw-memo', () => import('./memo.vue').then(m => m.default)); -Vue.component('mkw-notifications', () => import('./notifications.vue').then(m => m.default)); -Vue.component('mkw-timeline', () => import('./timeline.vue').then(m => m.default)); -Vue.component('mkw-calendar', () => import('./calendar.vue').then(m => m.default)); -Vue.component('mkw-rss', () => import('./rss.vue').then(m => m.default)); -Vue.component('mkw-trends', () => import('./trends.vue').then(m => m.default)); -Vue.component('mkw-clock', () => import('./clock.vue').then(m => m.default)); -Vue.component('mkw-activity', () => import('./activity.vue').then(m => m.default)); -Vue.component('mkw-photos', () => import('./photos.vue').then(m => m.default)); -Vue.component('mkw-digitalClock', () => import('./digital-clock.vue').then(m => m.default)); +export default function(app: App) { + app.component('mkw-welcome', () => import('./welcome.vue').then(m => m.default)); + app.component('mkw-memo', () => import('./memo.vue').then(m => m.default)); + app.component('mkw-notifications', () => import('./notifications.vue').then(m => m.default)); + app.component('mkw-timeline', () => import('./timeline.vue').then(m => m.default)); + app.component('mkw-calendar', () => import('./calendar.vue').then(m => m.default)); + app.component('mkw-rss', () => import('./rss.vue').then(m => m.default)); + app.component('mkw-trends', () => import('./trends.vue').then(m => m.default)); + app.component('mkw-clock', () => import('./clock.vue').then(m => m.default)); + app.component('mkw-activity', () => import('./activity.vue').then(m => m.default)); + app.component('mkw-photos', () => import('./photos.vue').then(m => m.default)); + app.component('mkw-digitalClock', () => import('./digital-clock.vue').then(m => m.default)); +} export const widgets = [ 'memo',