Execute function external component

  • Hi all,

    I am developing an extension but I have some problems, rather, difficulties due to my level in vue. I have my appointment-settings.vue component and i have my datetime component there <input-date :datetime.sync="appointment.start"></input-date>. Well, I made some changes to the datetime component, however it is the same concept. I have a select control where I load my employees in that control have an @change = "getDatesByEmployee(appointment.employee_id)". The question is ... How can I execute that function in my component input-date ?. I need to run this function to set my variable restdays [] in my input-date component. Some can help me? thanks for all

  • i have 3 files...


    1. components: {
    2. 'settings': require('../../components/appointment-settings.vue'),
    3. 'app-input-date': require('../../model/app-input-date.vue'),
    4. }


    1. <div class="uk-form-controls">
    2.     <select id="form-employee" name="employee" class="uk-width-1-1 c-select" v-model="appointment.employee_id" @change="getDatesByEmployee(appointment.employee_id)" v-validate:required>
    3.         <option v-for="worker in workers" :value="worker.id">{{worker.name}}</option>
    4.     </select>
    5. </div>


    So i need to execute my getDatesEmployee function in my input-date component but from my appointment-settings.vue..

    Thanks guys

  • Well ... i imported my app-input-date to my appointment-settings.vue

    And on my app-input-date.vue

    So... now i pass my restdays[] from appointment-settings.vue to app-input-date.vue without problems... see images

    [Blocked Image: https://imgur.com/E7AuoTT]

    how u can see when i select my employee control the restdays array is changed in my app-input-vue without problems

    [Blocked Image: https://imgur.com/oReGLCZ][Blocked Image: https://imgur.com/1BIDr7Q]

    also is loaded in my appointment-settings.vue

    [Blocked Image: https://imgur.com/8LvlWwO]

    So, i try to get my array data but i dont know how.. i execute a console.log(this.restdays) and...

    [Blocked Image: https://imgur.com/wOyE96M][Blocked Image: https://imgur.com/61g3UQ2]

    i cant take that array on my ready function but, is loaded in prop from my component.

    Any idea? thanks