2 years ago

Laravel -VueJS not working

Posted 2 years ago by Rainieren

Hello, I'm following Jeffrey's tutorial on how to edit a reply with Vue.

When he adds the non-existent reply tag, it gives him an error in the console and removes all the replies, But when I do the same it doesn't do anything at all, It still shows all the replies and it does not give me an error message, What is causing this? The blade file looks like this:

  <div class="row">
                <div class="col-md-9">
                    @foreach ($post->replies as $reply)
                        <reply inline-template> //Reply component is here
                            <div class="card mb-3">
                                <div class="card-header">
                                    <div class="card-title"><a href="">{{ $reply->owner->username }}</a> zei {{ $reply->created_at->diffForHumans() }}...</div>
                                <div class="card-body">
                                    {!! $reply->text !!}
                                <div class="card-footer level">

                                    <form method="POST" action="/replies/{{ $reply->id }}/likes">
                                        {{ csrf_field() }}
                                        <button type="submit" class="btn btn-theme btn-hover" {{ $reply->isLiked() ? 'disabled' : '' }}>
                                            <i class="fa fa-thumbs-o-up"></i> {{ $reply->likes()->count() }}

                                    @can('update', $reply)
                                        <form method="POST" action="/replies/{{ $reply->id }}">
                                            {{ csrf_field() }}
                                            {{ method_field('DELETE') }}
                                            <button type="submit" class="btn btn-sm btn-danger ml-2">Verwijder</button>
                                    <button class="btn btn-sm btn-secondary ml-2" @click="bewerken = true">Bewerk</button>

If I'm correct, and the reply component does not exist it shouldn't show all the replies, and it should give me an error stating that the component does not exist but it doesn't do any of that.

Thanks in advance

Please sign in or create an account to participate in this conversation.