79482091

Date: 2025-03-03 20:44:29
Score: 1
Natty:
Report link

My bad, I didn't read the documentation carefully. so i had to use @assets to include the Quill.js assets and @scripts to execute the initialization script when navigating using wire:navigate. This ensures that Quill.js is properly loaded and initialized every time you navigate.

@assets
    <link rel="stylesheet" href="https://cdn.quilljs.com/1.3.6/quill.snow.css">
    <script src="https://cdn.quilljs.com/1.3.6/quill.min.js"></script>
@endassets

@scripts
    <script>
        document.addEventListener("livewire:navigated", () => {
            const quill = new Quill("#editor", {
                theme: "snow",
            });
        });
    </script>
@endscripts

Explanation:

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @assets
  • User mentioned (0): @scripts
  • User mentioned (0): @assets
  • User mentioned (0): @endassets
  • User mentioned (0): @scripts
  • User mentioned (0): @endscripts
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Mebrouki Amine