spatie / laravel-comments-app

An application for testing out laravel-comments
https://laravel-comments.com
4 stars 2 forks source link

Reply textarea and button does not show when using with laravel 10 and @vite['app.js'] #8

Closed fburgosq closed 4 months ago

fburgosq commented 8 months ago

Hello Laravel Comments team. I think this is not AN ISSUE, per se, but would like to know if there is a trick to make it work.

I have a laravel 10 with @vite['app.js'], the topleve comments WORKS fine, but after comment if i refresh the page (its important to notice refresh the page) if user tries to reply, the reply textarea and button does not open. Also de Reactions does not open as well, Check image below.

Screenshot 2023-11-27 at 9 54 10 a m

Below is the code i have for the basic template, IF I REMOVE the @vite['app.js'] it work

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <title>Playing with laravel comments</title>
    @livewireStyles
    <x-comments::styles />
    @vite(['resources/sass/app.scss', 'resources/js/app.js'])

    <style>
        [x-cloak] {
            display: none !important;
        }
    </style>
</head>
<body>
<div id="app">
    <div id="center-column" class="m-auto">

        @auth
            <livewire:comments :model="$post"/>
        @endauth

        @guest
            <livewire:comments read-only :model="$post"/>

            <p class="comments-no-comment-yet">
                Log in to make a comment...
            </p>
        @endguest

    </div>
</div>
@livewireScripts
</body>
</html>

Any way to work the UI out of liveware with blade or Vuejs3? Or is there a trick to make it work with Vite and liveware, most of the projects that i would to include this package are using vitejs and vuejs3 (not livewire) Thanks in advance.

spatie-bot commented 4 months ago

Dear contributor,

because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it.