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.

.
Menu