mostafalaravel
7 months ago
17
0
Vue

how to change params in child component

Posted 7 months ago by mostafalaravel

Hello

In the current component : "action_details" I call the "participations" component:

...
            </div>
        </div>

        <div class="card-title">
        <participations></participations>
</div>

    </div>
</template>

This component "action_details" have :

<script>
    import Participations from "./participations";
    export default {
        name: "action_details",
        components: {Participations},
        data() {
            return {
                actionDetails: null,
            }
        },
        methods: {
            getAction_details: function (action) {
                let self = this;
                axios.get(process.env.MIX_APP_URL + `/api/actions/` + action, {

                })
                    .then(response => {
                        delete response.data.id
                        self.actionDetails = response.data
                    })
                    .catch(e => {
                        this.errors.push(e)
                    })

            },
            listRelatedParticipations: function () {
                let self = this;
            }
        },
        mounted() {
            let self = this;
            self.getAction_details(process.env.MIX_ACTION_DETAIL_ID);
        }
    }
</script>

I would like to create function: listRelatedParticipations

to set the parameter "action_number" in the child component "participations" to list only participations with -lets say action_number=10001 -

here the "participations" component JS :

...
       data() {
            return {
                participationFilterContent: {
                    "action_number": null,
                    "status": null,
                    "participation_date": null,
                    "name": null,
                    "firstname": null,
                    "address": null,
                    "streetnumber": null,
                    "box": null,
                    "country": null,
                    "zipcode": null,
                    "city": null,
                    "telephone": null,
                    "mobile": null,
                    "email": null,
                    "iban": null,
                    "bic": null,
                    "participation_id": null,
                    "refusal_responds_participation_id": null,
                    "repayment_information": null,
                    "page": 1,
                    "per_page": 25
                },
                participationsList: [],
                total: 0,
                last_page: 1,
                select_per_page: [25, 50, 100]
            }
        },
...

Please sign in or create an account to participate in this conversation.