Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

prevent alpine js from rendering components during refresh

<style>
[x-cloak] { display: none }
</style>
<body x-cloak x-data="{openModal: false}"
 :class="openModal ? 'overflow-hidden' : 'overflow-visible'"
>

// button
<button @click="openModal = true">
Open Modal
</button>
<!-- Modal -->
<div x-show="openModal">
<!-- content --> 
</div>
</body>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #prevent #alpine #js #rendering #components #refresh
ADD COMMENT
Topic
Name
3+4 =