VueJS props issue something missing

Viewed 33

I have a tabbed view and I need to pass a value from a select field to the tabs but I don't get props right. This is the parent:

<template>
  <div>
    <b-form-group id="memberListing" label-for="memberListing" class="mr-sm-2">
      <b-form-select
        v-model="memberSelection"
        :title="memberSelection"
        @change="getUserID"
        aria-describedby="memberListing"
      >
        <option disabled value="" selected>Mitglied auswählen</option>

        <option
          v-for="member in memberList"
          v-bind:key="member"
          :value="member.cb_userid"
          lazy
        >
          {{member.user_name}}
        </option>
      </b-form-select>
    </b-form-group>
    <Biometrics :title="memberSelection"></Biometrics>

    <b-card title="Card Title" no-body>
      <b-card-header header-tag="nav">
        <b-nav card-header tabs>
          <b-nav-item to="/users/profile" exact exact-active-class="active"
            >Profil</b-nav-item
          >
          <b-nav-item
            to="/users/trainingsplans"
            exact
            exact-active-class="active"
            >Trainingspläne</b-nav-item
          >
          <b-nav-item to="/users/biometrics" exact exact-active-class="active"
            >Biometrie</b-nav-item
          >
        </b-nav>
      </b-card-header>

      <b-card-body>
        <router-view></router-view>
      </b-card-body>
    </b-card>
  </div>
</template>

<script>
import axios from 'axios'
import Biometrics from "@/components/users/biometrics.vue";
export default {
    data: () => {
        return {
            profileList: 'http://localhost:8000/userProfiles/profileList',
            memberList: [],
            memberSelection: null,
        }
    },
    props: {
    },
    components: {
        Biometrics
    },
    async mounted() {
        try {
            let memberListData = await axios.get(this.profileList)
            this.memberList = memberListData.data
            console.log(this.memberList)
        } catch (e) {
            this.errors.push(e)
        }
    },
    methods: {
        getUserID: function () {
            // this.childMemberSelect = this.memberSelection
            // console.log(this.childMemberSelect)
        },
    },
}
</script>

What am I missing? I'm trying for hours now but I cant get the value to show up in the specified tab when I select the value.

1 Answers

this is the child :

<pre>
    <template>
     <div>
     {{title}} 
     </div>
    </template>
    <script>
    export default {
      created () {
          console.log(this.title)
      },
      methods: {},
     props: {
         title: Number,
     },
            data() {
                return {
                }
            },
        components:{},
    }
    </script>

</pre>
Related