diff --git a/platform/nativescript/runtime/index.js b/platform/nativescript/runtime/index.js index 949cabc8..be263d72 100644 --- a/platform/nativescript/runtime/index.js +++ b/platform/nativescript/runtime/index.js @@ -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 } }) diff --git a/samples/app/595.js b/samples/app/595.js new file mode 100644 index 00000000..0cd50d6d --- /dev/null +++ b/samples/app/595.js @@ -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: ` + + + + + + + + + ` +}).$start()