SetTimeout usage of Asynchronous problems in vue projects

existing projects create merchandise modules for selected specifications, sealed separately in a subcomponent. When you do the editing function, you need to pass values to the subcomponents, and you need to reflect the values you have selected. First of all, when the page is loaded, the data should be initialized, that is, the list of specifications should be queried first. However, when the reflection is done, it cannot be successful, and the print has no initialization data. That is, it involves initializing the data and reflecting the data successively. I used setTimeout in the created hook function to delay 500ms and then assign the reflected value to it. But I don"t think it"s good ~ and it"s not good to set the time to 100ms.

can I use setTimeout? what are the advantages and disadvantages?
is there a better way to implement? thank you


if you write in the create hook function, the data has not come yet. Of course, printing the data that has not been initialized, ah, the disadvantage of using setTimeout is that it is difficult to grasp the time. If the setting time is long, the time is wasted, the time is short, and the data will not come out. Therefore, the building mainly finds the point where the data comes, and the landlord should use props to transmit the data. It is recommended to use watch to observe this data. When the data is passed, Trigger the corresponding event

export default {
    props: {
        data
    },
    watch: {
        data (val) {
            // 
            console.log(val)
        }
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bece61-14075.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bece61-14075.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?