I use <users-component :user-name={{ Auth::user()->name }}></users-component>
inside my example.blade.php
file (users-component is a Vue component) and inside of users-component
I have a code:
<template>
<div>
<button v-on:click="sendMessage">sendMessage()</button>
</div>
</template>
<script>
export default {
data(){
return{
messageText: ''
}
},
props: {
userName: String
},
methods:{
sendMessage(){
this.$emit('messagesent', {
message:this.messageText,
user: {
name: this.userName
}
});
this.messageText = '';
}
}
}
</script>
After click in my button "sendMessage()" I have an error:
[Vue warn]: Property or method "agnieszka" is not defined on the instance but referenced during render. Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property.
How can I fix it?
agnieszka
? - Kapitan Teemo<users-component :user-name={{ Auth::user()->name }}></users-component>
- sailormoon