Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@script not working #27

Open
bartjuh4 opened this issue Dec 5, 2024 · 3 comments
Open

@script not working #27

bartjuh4 opened this issue Dec 5, 2024 · 3 comments

Comments

@bartjuh4
Copy link

bartjuh4 commented Dec 5, 2024

We want to use the @script directive, but it seems it's not been added for twig yet?

https://livewire.laravel.com/docs/javascript

@script
<script>
    // This Javascript will get executed every time this component is loaded onto the page...
</script>
@endscript
@mbardelmeijer
Copy link
Member

Good question, indeed currently not supported. Open to PRs of course to add support!

@bartjuh4
Copy link
Author

bartjuh4 commented Dec 5, 2024

Cool, will take a look at this!

@bartjuh4
Copy link
Author

bartjuh4 commented Dec 6, 2024

Script directive is working, will also add the assets directive:

@assets
<script src="https://cdn.jsdelivr.net/npm/pikaday/pikaday.js" defer></script>
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/pikaday/css/pikaday.css">
@endassets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants