File tree 4 files changed +15
-6
lines changed
4 files changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -284,6 +284,12 @@ export interface ComponentInternalInstance {
284
284
*/
285
285
emitsOptions : ObjectEmitsOptions | null
286
286
287
+ /**
288
+ * resolved inheritAttrs options
289
+ * @internal
290
+ */
291
+ inheritAttrs ?: boolean
292
+
287
293
// the rest are only for stateful components ---------------------------------
288
294
289
295
// main proxy that serves as the public instance (`this`)
@@ -464,6 +470,9 @@ export function createComponentInstance(
464
470
// props default value
465
471
propsDefaults : EMPTY_OBJ ,
466
472
473
+ // inheritAttrs
474
+ inheritAttrs : type . inheritAttrs ,
475
+
467
476
// state
468
477
ctx : EMPTY_OBJ ,
469
478
data : EMPTY_OBJ ,
Original file line number Diff line number Diff line change @@ -755,7 +755,7 @@ export function applyOptions(
755
755
resolveInstanceAssets ( instance , options , FILTERS )
756
756
}
757
757
758
- if ( inheritAttrs !== undefined ) instance . type . inheritAttrs = inheritAttrs
758
+ if ( inheritAttrs !== undefined ) instance . inheritAttrs = inheritAttrs
759
759
}
760
760
761
761
// lifecycle options
Original file line number Diff line number Diff line change @@ -55,7 +55,8 @@ export function renderComponentRoot(
55
55
renderCache,
56
56
data,
57
57
setupState,
58
- ctx
58
+ ctx,
59
+ inheritAttrs
59
60
} = instance
60
61
61
62
let result
@@ -123,7 +124,7 @@ export function renderComponentRoot(
123
124
; [ root , setRoot ] = getChildRoot ( result )
124
125
}
125
126
126
- if ( fallthroughAttrs && Component . inheritAttrs !== false ) {
127
+ if ( fallthroughAttrs && inheritAttrs !== false ) {
127
128
const keys = Object . keys ( fallthroughAttrs )
128
129
const { shapeFlag } = root
129
130
if ( keys . length ) {
@@ -190,7 +191,7 @@ export function renderComponentRoot(
190
191
) {
191
192
const { class : cls , style } = vnode . props || { }
192
193
if ( cls || style ) {
193
- if ( __DEV__ && Component . inheritAttrs === false ) {
194
+ if ( __DEV__ && inheritAttrs === false ) {
194
195
warnDeprecation (
195
196
DeprecationTypes . INSTANCE_ATTRS_CLASS_STYLE ,
196
197
instance ,
Original file line number Diff line number Diff line change @@ -128,8 +128,7 @@ function renderComponentSubTree(
128
128
if ( ssrRender ) {
129
129
// optimized
130
130
// resolve fallthrough attrs
131
- let attrs =
132
- instance . type . inheritAttrs !== false ? instance . attrs : undefined
131
+ let attrs = instance . inheritAttrs !== false ? instance . attrs : undefined
133
132
let hasCloned = false
134
133
135
134
let cur = instance
You can’t perform that action at this time.
0 commit comments