I'm getting this syntax error when I try to bind a session variable as a prop of my vue component. I reviewed my code and I haven't found the mistake in my code. But more eyes could spot something, I hope.
Here is where I register my components:
Vue.component('fav-btn', require('../components/FavBtn.vue'));
Vue.component('fund-btn', require('../components/FundBtn.vue'));
Vue.component('flash-msg', require('../components/FlashMsg.vue'));
const vm = new Vue({
el: '#app'
});
Here is the component that is giving me trouble:
<template>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
text here
</div>
</template>
<script>
export default{
name: 'FlashMsg',
props: ['message'],
data(){
return{
}
}
}
</script>
And here is how I use it in my view:
<flash-msg v-bind:message="{{ session('message') }}"></flash-msg>
Here when I remove the bind directive the component loads without any problem. So maybe there is problem with the passed data from session? I use Laravel as my backend.
Here is the error:
[Vue warn]: Failed to generate render function:
SyntaxError: Unexpected token } in
with(this){return _c('div',{attrs:{"id":"app"}},[_c('flash-msg',{attrs:{"message":}}),