File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
test/unit/specs/directives/internal Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -118,12 +118,17 @@ export default {
118
118
119
119
resolveComponent ( id , cb ) {
120
120
var self = this
121
- this . pendingComponentCb = cancellable ( function ( Component ) {
121
+ var done = function ( Component ) {
122
122
self . ComponentName = Component . options . name || id
123
123
self . Component = Component
124
124
cb ( )
125
- } )
126
- this . vm . _resolveComponent ( id , this . pendingComponentCb )
125
+ }
126
+ if ( typeof id === 'function' ) {
127
+ done ( id )
128
+ } else {
129
+ this . pendingComponentCb = cancellable ( done )
130
+ this . vm . _resolveComponent ( id , this . pendingComponentCb )
131
+ }
127
132
} ,
128
133
129
134
/**
Original file line number Diff line number Diff line change @@ -134,6 +134,19 @@ describe('Component', function () {
134
134
} )
135
135
} )
136
136
137
+ it ( ':is using raw component constructor' , function ( ) {
138
+ new Vue ( {
139
+ el : el ,
140
+ template : '<component :is="$options.components.test">' ,
141
+ components : {
142
+ test : {
143
+ template : 'hi'
144
+ }
145
+ }
146
+ } )
147
+ expect ( el . textContent ) . toBe ( 'hi' )
148
+ } )
149
+
137
150
it ( 'keep-alive' , function ( done ) {
138
151
var spyA = jasmine . createSpy ( )
139
152
var spyB = jasmine . createSpy ( )
You can’t perform that action at this time.
0 commit comments