-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Component/Livewire attribute error #65
Comments
Hi @wit3. Thanks for trying out. I think I had that behavior in an earlier version, but I think it was fixed in recent version. ❯ cat example.blade.php
<x-component-name type="error" :content="$message->content" />
❯ yarn run prettier example.blade.php
yarn run v1.22.10
$ prettier --plugin . --plugin-search-dir . example.blade.php
<x-component-name type="error"
:content="$message->content" />
Can you post the version of prettier-plugin-blade you tried and preferably the whole template? |
packages.json
**Example blade file: tab-list-relations.blade.php ** <div class="px-4 sm:px-0 mt-6" x-data="{ tab: window.location.hash ? window.location.hash : '#tab1' }">
<div class="hidden sm:block">
<nav class="relative z-0 rounded-lg shadow flex divide-x divide-gray-200" aria-label="Tabs">
@foreach ($this->relations as $k => $relation )
<a href="#" aria-current="page"
class="text-gray-900 rounded-l-lg group relative min-w-0 flex-1 overflow-hidden bg-white py-4 px-6 text-sm font-medium text-center hover:bg-gray-50 focus:z-10"
x-on:click.prevent="tab='#tab1'">
<span>Consumi</span>
<span aria-hidden="true" :class="tab == '#tab1' ? 'bg-red-500' : 'bg-transparent'"
class="absolute inset-x-0 bottom-0 h-0.5"></span>
</a>
@endforeach
</nav>
</div>
<div class="mt-6">
@foreach ($this->relations as $k => $relation )
<div x-show="tab == '#tab{{$k}}'" x-cloak>
<livewire:widgets.invoice-document-consumption.card :invoice_document_id="$this->invoiceDocument->id" />
</div>
@endforeach
</div>
</div> if i run Output: <div class="mt-6 px-4 sm:px-0" x-data="{ tab: window.location.hash ? window.location.hash : '#tab1' }">
<div class="hidden sm:block">
<nav class="relative z-0 flex divide-x divide-gray-200 rounded-lg shadow" aria-label="Tabs">
@foreach ($this->relations as $k => $relation)
<a href="#" aria-current="page"
class="group relative min-w-0 flex-1 overflow-hidden rounded-l-lg bg-white py-4 px-6 text-center text-sm font-medium text-gray-900 hover:bg-gray-50 focus:z-10"
x-on:click.prevent="tab='#tab1'">
<span>Consumi</span>
<span aria-hidden="true" :class="tab == '#tab1' ? 'bg-red-500' : 'bg-transparent'"
class="absolute inset-x-0 bottom-0 h-0.5"></span>
</a>
@endforeach
</nav>
</div>
<div class="mt-6">
@foreach ($this->relations as $k => $relation)
<div x-show="tab == '#tab{{ $k }}'" x-cloak>
<livewire:widgets.invoice-document-consumption.card
:invoice_document_id="$this - > invoiceDocument - > id" />
</div>
@endforeach
</div>
</div> |
Thanks @wit3. For temporary workaround, you can use the e.g. @livewire('show-post', ['post' => $post]) I'll try to fix the behaviour so that you can use |
Hi, if i try to use cli on blade that has component or livewire tag, the plugin add me space in variable chain.
Before:
After:
It's a bug or an option?
The text was updated successfully, but these errors were encountered: