Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion platform/nativescript/runtime/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Vue.prototype.$start = function() {
// Define a `nativeView` getter in every NS vue instance
Object.defineProperty(Vue.prototype, 'nativeView', {
get() {
return this.$el.nativeView
return this.$el ? this.$el.nativeView : undefined
}
})

Expand Down
36 changes: 36 additions & 0 deletions samples/app/595.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
const Vue = require('nativescript-vue')

Vue.config.debug = true
Vue.config.silent = false

Plugin = {
install(Vue, name) {
Vue.prototype.$name = name

Vue.mixin({
beforeCreate: function() {
setTimeout(() => {
console.log('this.$options: ', this.$options)
}, 5000)
}
})
}
}

Vue.use(Plugin, 'pluginName')

new Vue({
data: {},
template: `
<Frame>
<Page>
<ActionBar title="Issue #595" />

<StackLayout>
<Label text="This app should not crash in 5 seconds" />
<Label text="You will see a dump of this.$options in console" />
</StackLayout>
</Page>
</Frame>
`
}).$start()