Last active
November 11, 2021 13:58
-
-
Save umutyerebakmaz/8fe3ab8424046224bfce469d26efccf5 to your computer and use it in GitHub Desktop.
Laravel 8 - Bundling AlpineJS component files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Alpine from 'alpinejs'; | |
import filterComponent from "./components/filter"; | |
window.filterComponent = filterComponent; | |
window.Alpine = Alpine; | |
Alpine.start(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div x-data="filterComponent()"> | |
component content | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default () => { | |
console.log('FilterComponent Initialized!'); | |
return { | |
filter1: false, | |
filter2: false, | |
filter3: false | |
} | |
} | |
// don't forget to run bundle command after all |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment