From 2ffc0a7642dc731877cdc198482fb8c480b15a72 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Sat, 8 Jul 2017 00:19:12 +0300 Subject: [PATCH] Create/mount all native views after app.start --- platform/nativescript/runtime/index.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/platform/nativescript/runtime/index.js b/platform/nativescript/runtime/index.js index aec6090b..7bc9c841 100644 --- a/platform/nativescript/runtime/index.js +++ b/platform/nativescript/runtime/index.js @@ -39,15 +39,18 @@ Vue.prototype.$start = function () { } const mount = function (el, hydrating) { - mountComponent(this, el, hydrating) - if (this.__is_root__) { - let view = this.$el.nativeView + const self = this start({ create() { - return view + // Call mountComponent in the create callback when the IOS app loop has started + // https://github.com/rigor789/nativescript-vue/issues/24 + mountComponent(self, el, hydrating) + return self.$el.nativeView; } }) + } else { + mountComponent(this, el, hydrating) } }