File tree Expand file tree Collapse file tree 2 files changed +37
-1
lines changed
platform/nativescript/runtime Expand file tree Collapse file tree 2 files changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ Vue.prototype.$start = function() {
79
79
// Define a `nativeView` getter in every NS vue instance
80
80
Object . defineProperty ( Vue . prototype , 'nativeView' , {
81
81
get ( ) {
82
- return this . $el . nativeView
82
+ return this . $el ? this . $el . nativeView : undefined
83
83
}
84
84
} )
85
85
Original file line number Diff line number Diff line change
1
+ const Vue = require ( 'nativescript-vue' )
2
+
3
+ Vue . config . debug = true
4
+ Vue . config . silent = false
5
+
6
+ Plugin = {
7
+ install ( Vue , name ) {
8
+ Vue . prototype . $name = name
9
+
10
+ Vue . mixin ( {
11
+ beforeCreate : function ( ) {
12
+ setTimeout ( ( ) => {
13
+ console . log ( 'this.$options: ' , this . $options )
14
+ } , 5000 )
15
+ }
16
+ } )
17
+ }
18
+ }
19
+
20
+ Vue . use ( Plugin , 'pluginName' )
21
+
22
+ new Vue ( {
23
+ data : { } ,
24
+ template : `
25
+ <Frame>
26
+ <Page>
27
+ <ActionBar title="Issue #595" />
28
+
29
+ <StackLayout>
30
+ <Label text="This app should not crash in 5 seconds" />
31
+ <Label text="You will see a dump of this.$options in console" />
32
+ </StackLayout>
33
+ </Page>
34
+ </Frame>
35
+ `
36
+ } ) . $start ( )
You can’t perform that action at this time.
0 commit comments