At the moment, I have a Laravel route that directs to the index function of my controller with an ID passed, where I then return the ID in a view.
public function index($id)
{
return view('progress')
->with('identifier', $id);
}
Within the component loaded in this view, I am attempting to access the identifier
as a prop in my Vue script.
props: ['identifier'],
methods: {
getInformation() {
this.$root.$emit('fetchEvent');
},
},
mounted () {
console.dir(this.identifier);
}
Unfortunately, I am seeing 'undefined' in my console and I cannot seem to figure out how to obtain the passed identifier
as a prop.
Is there something wrong with what I am doing?
update:
Here is the complete template code:
<template>
<div>
<div class="tab-content">
<item-component
:web-identifier="identifier"
></item-component>
</div>
</div>
</template>
<script>
export default {
props: ['identifier'],
methods: {
getInformation() {
this.$root.$emit('fetchEvent');
},
},
mounted () {
console.dir(this.identifier);
}
}
</script>
blade:
<div>
<task-detail-component></task-detail-component>
</div>