json_encode(Auth::user()->id) !!}">
<div class="media status-reply" v-for="reply in replies">
<a class="pull-left" :href="'/user/' + reply.user.username">
<div class="avatar-parent">
<img class="media-object img-responsive img-circle" :alt="reply.user.username" :src="reply.avatar">
</div>
</a>
<form v-if="authId === reply.user.id" action="/status/delete" method="post">
{{ csrf_field() }}
<button type="submit" class="close pull-right" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</form>
<div class="media-body">
<h5 class="media-heading">@{{ reply.user.username }}</h5>
<p>@{{ reply.body }}</p>
<ul class="list-inline">
<li>@{{ reply.created_at }}</li>
<li>
{{-- <a :href="'/status/like/' + reply.id"><i :class="glyphicon glyphicon-heart{ reply.likes.count() ? '' : '-empty' }"></i></a> @{{ reply.likes.count() ?: '' }} --}}
</li>
</ul>
</div>
</div>
</replies>
app.js выглядит так
Vue.component('replies', {
props: ['repliesData', 'authId'],
data: function () {
return {
replies: [],
authId: [],
input: ''
}
},
});
const app = new Vue({
el: '#app',
});`
а в консоль выдает ошибки
Property or method "replies" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
Property or method "reply" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option.
Error in render function: "TypeError: Cannot read property 'id' of undefined"
TypeError: Cannot read property 'id' of undefined
😡
лучше закидывай куда-нибудь. тем более, вью можешь подключить хоть на кодпен
Обсуждают сегодня