Skip to content

Commit ccda251

Browse files
Alexander Vakrilovrigor789
Alexander Vakrilov
authored andcommitted
Create/mount all native views after app.start (nativescript-vue#28)
Resolves nativescript-vue#24
1 parent 9b1dfb2 commit ccda251

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

platform/nativescript/runtime/index.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,18 @@ Vue.prototype.$start = function () {
3939
}
4040

4141
const mount = function (el, hydrating) {
42-
mountComponent(this, el, hydrating)
43-
4442
if (this.__is_root__) {
45-
let view = this.$el.nativeView
43+
const self = this
4644
start({
4745
create() {
48-
return view
46+
// Call mountComponent in the create callback when the IOS app loop has started
47+
// https://github.com/rigor789/nativescript-vue/issues/24
48+
mountComponent(self, el, hydrating)
49+
return self.$el.nativeView;
4950
}
5051
})
52+
} else {
53+
mountComponent(this, el, hydrating)
5154
}
5255
}
5356

0 commit comments

Comments
 (0)