`$attrs` is nested
Version
3.1.4
Reproduction link
https://codesandbox.io/s/elegant-merkle-2t2rb?file=/src/App.vue
Steps to reproduce
- Open the code sandbox link
What is expected?
test: { "hello": "world" }
was supposed to be rendered.
What is actually happening?
test: { "attrs": { "hello": "world" } }
is rendered. $attrs
include a key attrs
.
render(h) {
return h(Test, {
attrs: {
hello: "world",
},
});
},
With the code above, I'm expecting the child component Test
would have correct $attrs
, but Vue 2 and Vue 3 behave differently.
In Vue 3, the actual data is wrapped with a key attrs
.
- Vue 2 sandbox: https://codesandbox.io/s/exciting-platform-zomcf?file=/src/App.vue
- Vue 3 sandbox: https://codesandbox.io/s/elegant-merkle-2t2rb?file=/src/App.vue
Is it an intentional breaking change that isn't documented (or I couldn't find)? Or is it a bug?