@@ -10,11 +10,20 @@ var cheerio = _interopDefault(require('cheerio'));
10
10
11
11
//
12
12
13
+ function startsWithTag ( str ) {
14
+ return str && str . trim ( ) [ 0 ] === '<'
15
+ }
16
+
13
17
function createVNodesForSlot (
14
18
h ,
15
19
slotValue ,
16
20
name
17
21
) {
22
+ if ( typeof slotValue === 'string' &&
23
+ ! startsWithTag ( slotValue ) ) {
24
+ return slotValue
25
+ }
26
+
18
27
var el = typeof slotValue === 'string'
19
28
? vueTemplateCompiler . compileToFunctions ( slotValue )
20
29
: slotValue ;
@@ -199,9 +208,16 @@ function createStubFromString (
199
208
}
200
209
201
210
function createBlankStub ( originalComponent ) {
211
+ var name = ( originalComponent . name ) + "-stub" ;
212
+
213
+ // ignoreElements does not exist in Vue 2.0.x
214
+ if ( Vue . config . ignoredElements ) {
215
+ Vue . config . ignoredElements . push ( name ) ;
216
+ }
217
+
202
218
return Object . assign ( { } , getCoreProperties ( originalComponent ) ,
203
219
{ render : function render ( h ) {
204
- return h ( ( ( originalComponent . name ) + "-stub" ) )
220
+ return h ( name )
205
221
} } )
206
222
}
207
223
@@ -262,10 +278,6 @@ function createComponentStubs (
262
278
components [ stub ] = Object . assign ( { } , stubs [ stub ] ) ;
263
279
}
264
280
}
265
- // ignoreElements does not exist in Vue 2.0.x
266
- if ( Vue . config . ignoredElements ) {
267
- Vue . config . ignoredElements . push ( ( stub + "-stub" ) ) ;
268
- }
269
281
} ) ;
270
282
}
271
283
return components
@@ -397,8 +409,7 @@ function createInstance (
397
409
398
410
addEventLogger ( _Vue ) ;
399
411
400
- var instanceOptions = Object . assign ( { } , options ,
401
- { propsData : Object . assign ( { } , options . propsData ) } ) ;
412
+ var instanceOptions = Object . assign ( { } , options ) ;
402
413
403
414
deleteMountingOptions ( instanceOptions ) ;
404
415
@@ -424,12 +435,10 @@ function createInstance (
424
435
_Vue . component ( c , stubComponents [ c ] ) ;
425
436
} ) ;
426
437
427
- var Constructor = ( typeof component === 'function' && component . prototype instanceof Vue )
438
+ var Constructor = vueVersion < 2.3 && typeof component === 'function'
428
439
? component . extend ( instanceOptions )
429
440
: _Vue . extend ( component ) . extend ( instanceOptions ) ;
430
441
431
- // const Constructor = _Vue.extend(component).extend(instanceOptions)
432
-
433
442
Object . keys ( instanceOptions . components || { } ) . forEach ( function ( key ) {
434
443
Constructor . component ( key , instanceOptions . components [ key ] ) ;
435
444
_Vue . component ( key , instanceOptions . components [ key ] ) ;
0 commit comments