This commit is contained in:
syuilo 2019-05-21 04:26:14 +09:00
parent cd4c7689b7
commit a434cfbe0d
No known key found for this signature in database
GPG Key ID: BDC4C49D06AB9D69
3 changed files with 19 additions and 20 deletions

View File

@ -60,7 +60,7 @@ init(async (launch, os) => {
});
if (o.cb) vm.$once('closed', o.cb);
} else {
this.$root.new(() => import('./views/components/post-form-window.vue').then(m => m.default), {
this.$root.newAsync(() => import('./views/components/post-form-window.vue').then(m => m.default), {
reply: o.reply,
mention: o.mention,
animation: o.animation == null ? true : o.animation

View File

@ -449,7 +449,14 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS], os: MiOS)
getMetaSync: os.getMetaSync,
signout: os.signout,
new(vm, props) {
if (typeof vm === 'function') {
const x = new vm({
parent: this,
propsData: props
}).$mount();
document.body.appendChild(x.$el);
return x;
},
newAsync(vm, props) {
return new Promise((res) => {
vm().then(vm => {
const x = new vm({
@ -460,14 +467,6 @@ export default (callback: (launch: (router: VueRouter) => [Vue, MiOS], os: MiOS)
res(x);
});
});
} else {
const x = new vm({
parent: this,
propsData: props
}).$mount();
document.body.appendChild(x.$el);
return x;
}
},
dialog(opts) {
const vm = this.new(Dialog, opts);

View File

@ -50,7 +50,7 @@ init((launch, os) => {
document.documentElement.style.overflow = 'auto';
}
this.$root.new(() => import('./views/components/post-form-dialog.vue').then(m => m.default), {
this.$root.newAsync(() => import('./views/components/post-form-dialog.vue').then(m => m.default), {
reply: o.reply,
mention: o.mention,
renote: o.renote