@@ -101,11 +101,11 @@ export function mount(
101
101
props [ k ] = v
102
102
}
103
103
104
- return app . $nextTick ( )
104
+ return vm . $nextTick ( )
105
105
}
106
106
107
- // create the vm
108
- const vm = createApp ( Parent )
107
+ // create the app
108
+ const app = createApp ( Parent )
109
109
110
110
// global mocks mixin
111
111
if ( options ?. global ?. mocks ) {
@@ -117,40 +117,40 @@ export function mount(
117
117
}
118
118
}
119
119
120
- vm . mixin ( mixin )
120
+ app . mixin ( mixin )
121
121
}
122
122
123
123
// use and plugins from mounting options
124
124
if ( options ?. global ?. plugins ) {
125
- for ( const use of options ?. global ?. plugins ) vm . use ( use )
125
+ for ( const use of options ?. global ?. plugins ) app . use ( use )
126
126
}
127
127
128
128
// use any mixins from mounting options
129
129
if ( options ?. global ?. mixins ) {
130
- for ( const mixin of options ?. global ?. mixins ) vm . mixin ( mixin )
130
+ for ( const mixin of options ?. global ?. mixins ) app . mixin ( mixin )
131
131
}
132
132
133
133
if ( options ?. global ?. components ) {
134
134
for ( const key of Object . keys ( options ?. global ?. components ) )
135
- vm . component ( key , options . global . components [ key ] )
135
+ app . component ( key , options . global . components [ key ] )
136
136
}
137
137
138
138
if ( options ?. global ?. directives ) {
139
139
for ( const key of Object . keys ( options ?. global ?. directives ) )
140
- vm . directive ( key , options . global . directives [ key ] )
140
+ app . directive ( key , options . global . directives [ key ] )
141
141
}
142
142
143
143
// provide any values passed via provides mounting option
144
144
if ( options ?. global ?. provide ) {
145
145
for ( const key of Reflect . ownKeys ( options . global . provide ) ) {
146
146
// @ts -ignore: https://github.com/microsoft/TypeScript/issues/1863
147
- vm . provide ( key , options . global . provide [ key ] )
147
+ app . provide ( key , options . global . provide [ key ] )
148
148
}
149
149
}
150
150
151
151
// add tracking for emitted events
152
152
const { emitMixin, events } = createEmitMixin ( )
153
- vm . mixin ( emitMixin )
153
+ app . mixin ( emitMixin )
154
154
155
155
// stubs
156
156
if ( options ?. global ?. stubs ) {
@@ -160,7 +160,7 @@ export function mount(
160
160
}
161
161
162
162
// mount the app!
163
- const app = vm . mount ( el )
163
+ const vm = app . mount ( el )
164
164
165
- return createWrapper ( app , events , setProps )
165
+ return createWrapper ( app , vm , events , setProps )
166
166
}
0 commit comments