I have a component that I only want to load once in my Volt project. Loading more than once will cause problems, similarly to loading the OpalRb library more than once. To clarify, I am loading this component in a view file, and it keeps getting loaded because the line loading the component keeps getting called every time the page gets hit:
{{ if condition }}
{{ require 'component/lib/file' # this line keeps getting called }}
{{ end }}
How do I set up my code so that I can load a component only once?
Aucun commentaire:
Enregistrer un commentaire