The problem of passing values from parent components to child components in vue

instance code:
parent component:

<div class="parent">
    
</div>
<script>
    data(){
        return{
            id:this.$route.query.id
        }
    }
</script>

Sub-component:

<div class="children">
</div>
<script>
    data(){
        return{
            id:this.$parent.id
        }
    }
</script>

Why can"t you get the id of the parent component by writing like this

Sep.22,2021

first: you print out the this.$parent and take a look at
second: you need to understand the vue father-son transmission worth mechanism
take a look at this
ide/components-props.html" rel=" nofollow noreferrer "> https://cn.vuejs.org/v2/guide.

.
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-1b36d86-2c04f.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-1b36d86-2c04f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?