File tree 1 file changed +12
-6
lines changed
packages/server-renderer/src
1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 4
4
ComponentInternalInstance ,
5
5
DirectiveBinding ,
6
6
Fragment ,
7
+ FunctionalComponent ,
7
8
mergeProps ,
8
9
ssrUtils ,
9
10
Static ,
@@ -112,12 +113,17 @@ function renderComponentSubTree(
112
113
const comp = instance . type as Component
113
114
const { getBuffer, push } = createBuffer ( )
114
115
if ( isFunction ( comp ) ) {
115
- renderVNode (
116
- push ,
117
- ( instance . subTree = renderComponentRoot ( instance ) ) ,
118
- instance ,
119
- slotScopeId
120
- )
116
+ let root = renderComponentRoot ( instance )
117
+ // #5817 scope ID attrs not falling through if functional component doesn't
118
+ // have props
119
+ if ( ! ( comp as FunctionalComponent ) . props ) {
120
+ for ( const key in instance . attrs ) {
121
+ if ( key . startsWith ( `data-v-` ) ) {
122
+ ; ( root . props || ( root . props = { } ) ) [ key ] = ``
123
+ }
124
+ }
125
+ }
126
+ renderVNode ( push , ( instance . subTree = root ) , instance , slotScopeId )
121
127
} else {
122
128
if (
123
129
( ! instance . render || instance . render === NOOP ) &&
You can’t perform that action at this time.
0 commit comments