Hello everyone,
I'm working on a Livewire project and facing an issue where a JavaScript script is not executing in one of my component views. Here's the setup:
I have a main view that dynamically includes different component views based on the value of $activeTab. When $activeTab is set to a specific value, the corresponding view is included.
Example:
<div class="mt-4 ml-4 w-full">
@if ($activeTab == 'tags')
@include('livewire.campaign.tags')
@endif
<!-- Other tabs-->
</div>
In one of these included views (livewire.campaign.tags), I have a simple script:
<div>
<!-- Some HTML code -->
<script>
console.log('test tags script');
</script>
</div>
However, this script is not being executed. I'm looking for a way to execute JavaScript within the dynamically included Livewire component views. Any suggestions or solutions would be greatly appreciated!
Thanks in advance!