Subscribe on changes!

The parent component passes a parameter to the child component. After receiving the parameter, the props cannot use the data.

avatar
Jul 12th 2022

Vue version

3.2.25

Link to minimal reproduction

https://sfc.vuejs.org/#eNplUsGO0zAQ/RVvLk2l1hbXKK2WA4K9rRQJLrmkyaT14tiW7bRCVSTEZdUD7I0TX8ANLmiX36GFz2DstGkFl8Qz73nmvRlvo+da03ULURKltjRcO2LBtXqeS95oZRzZEgM16UhtVENGSB0NUGshc8rAEbtm1kdn/KVSlc3etkecskxJ3wwZpZLW1156ClafDcXicS5PeGOXiGD/ePQKhFDkjTKiuhohJWW9XBSKgYNGi8IBRoSkq2fz7TZc7rqUYRSyXOrWkfW0URWIWR4hnkc9NAhNgh4Ew59yWSvkpOxEQHrKhmbRJOqdTptC0zurJI5x6yvmR8DmUUJCxufQuo/zaOWctgljti79PO4sVWbJ8ERNKx1vgIJtpgujNhYMFs4jX6LLZYctj0P8d2NEFHKJyn1PIosG8HySHXwO+wzZG7Q2IZmG8gb9TMjrQrRg/XnY9TVz7zRYVhWuOC91sblVGzAZuIHWOi4sOwNIPm1QG6Ut7rCCmku49VEa5hEGnJy1oLd5v/q6laXjSpJyhY4gAwGlgyq27SK5kDkhHL/JYGHcz5kxsn/8fvi0O+zeH77sfj09+ayn0nW4S2tlXhTlKuZkNicxp/bYAFXWhbAwRhWhzp/7r/sf335/eNzf/9w/fN4/fPQAyri8cnUZo4neuBJAhVrGwT7W+y9Hg//Ldxx1fwGZJEmh

Steps to reproduce

just Props pass parameter problem

What is expected?

The parameters received by props are available

What is actually happening?

Props can use console.log to show that there is a goods property in it, but it cannot print goods directly

System Info

No response

Any additional comments?

The parent component passes a parameter to the child component. After receiving the parameter, the props cannot use the data.

Props can use console.log to show that there is a goods property in it, but it cannot print goods directly I found that using the Watch listener solved this problem, but it was clearly not the approach we wanted

avatar
Jul 12th 2022

This reproduction does not run as it tries to import a non-existant store. please note that a runnable reproduction is required.

My suspicion would be that your parent passes data only on a second re-render, after the store has fetched it.

You can ask the community for guidance on how to work best in this scenario.