Vue prop from Laravel blade
I think in earliest version of L/V is worked, but now props in undefined...
// this is a blade file
<app :foo="{{ auth()->check() }}"></app>
How do you retrieve your props in VueJS ? I don't think that props is undefined ... what is undefined ? the foo variable ? something else ?
@vincent15000
<script setup>
const props = defineProps(['foo'])
</script>
@Ajvanho What version of VueJS do you use ?
@vincent15000 Of course, the authenticated user is on the backend, I have value only on backend.
@Ajvanho I really don't understand why you say that. In your VueJS component, you have to declare your props to be able to retrieve them.
<template>
</template>
<script>
export default {
props: {
...
},
data() {
return {
...
}
},
computed: {
...
},
methods: {
}
}
</script>
<style scoped>
</style>
Please or to participate in this conversation.