area17 / blast

Storybook for Laravel Blade 🚀

Home Page:https://dev.to/area17/getting-started-with-blast-storybook-for-laravel-blade-c5c

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FEATURE-REQUEST] Use @stack directive

yokozawa0701 opened this issue · comments

Hi, We're using Alpine.js in my project.
And I like using Alpine.store() with push directive rather than writing in HTML like below.

some-component.blade.html

<div data="darkMode"
  <!-- some component -->
</div>

@push('scripts')
  <script>
      document.addEventListener('alpine:init', () => {
          Alpine.store('darkMode', {
              on: false,
   
              toggle() {
                  this.on = ! this.on
              }
          })
      })
  </script>
@endpush

What do you think about making push directives available?

Hi! This should work out of the box. You'll need to publish the storybook.blade.php layout to your app using php artisan vendor:publish --provider="A17\Blast\BlastServiceProvider" --tag="blast-views" and then add the @stack directive there.

@mrtimbrook

Oh, it's has work very well! Thanks!