Skip to content

Commit 1520986

Browse files
committed
fix(ssr): inheritAttrs false do not working with non-root component (vuejs#11297)
1 parent 1a5aa54 commit 1520986

File tree

1 file changed

+4
-0
lines changed
  • src/platforms/web/server/modules

1 file changed

+4
-0
lines changed

src/platforms/web/server/modules/attrs.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ export default function renderAttrs (node: VNodeWithData): string {
2525
if (isUndef(opts) || opts.Ctor.options.inheritAttrs !== false) {
2626
let parent = node.parent
2727
while (isDef(parent)) {
28+
// Stop fallthrough in case parent has inheritAttrs option set to false
29+
if (parent.componentOptions && parent.componentOptions.Ctor.options.inheritAttrs === false) {
30+
break;
31+
}
2832
if (isDef(parent.data) && isDef(parent.data.attrs)) {
2933
attrs = extend(extend({}, attrs), parent.data.attrs)
3034
}

0 commit comments

Comments
 (0)