File tree 2 files changed +22
-2
lines changed
test/unit/modules/compiler
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -86,8 +86,12 @@ export function parse (
86
86
platformMustUseProp = options . mustUseProp || no
87
87
platformGetTagNamespace = options . getTagNamespace || no
88
88
const isReservedTag = options . isReservedTag || no
89
- maybeComponent = ( el : ASTElement ) => ! ! el . component || ! isReservedTag ( el . tag )
90
-
89
+ maybeComponent = ( el : ASTElement ) => ! ! (
90
+ el . component ||
91
+ el . attrsMap [ ':is' ] ||
92
+ el . attrsMap [ 'v-bind:is' ] ||
93
+ ! ( el . attrsMap . is ? isReservedTag ( el . attrsMap . is ) : isReservedTag ( el . tag ) )
94
+ )
91
95
transforms = pluckModuleFunction ( options . modules , 'transformNode' )
92
96
preTransforms = pluckModuleFunction ( options . modules , 'preTransformNode' )
93
97
postTransforms = pluckModuleFunction ( options . modules , 'postTransformNode' )
Original file line number Diff line number Diff line change @@ -909,4 +909,20 @@ describe('parser', () => {
909
909
expect ( ast . children [ 2 ] . type ) . toBe ( 3 )
910
910
expect ( ast . children [ 2 ] . text ) . toBe ( '\ndef' )
911
911
} )
912
+
913
+ // #10152
914
+ it ( 'not warn when scoped slot used inside of dynamic component on regular element' , ( ) => {
915
+ parse ( `
916
+ <div>
917
+ <div is="customComp" v-slot="slotProps"></div>
918
+ <div :is="'customComp'" v-slot="slotProps"></div>
919
+ <div v-bind:is="'customComp'" v-slot="slotProps"></div>
920
+ </div>
921
+ ` , baseOptions )
922
+ expect ( 'v-slot can only be used on components or <template>' ) . not . toHaveBeenWarned ( )
923
+
924
+ parse ( `<div is="customComp"><template v-slot="slotProps"></template></div>` , baseOptions )
925
+ expect ( `<template v-slot> can only appear at the root level inside the receiving the component` )
926
+ . not . toHaveBeenWarned ( )
927
+ } )
912
928
} )
You can’t perform that action at this time.
0 commit comments