Reputation: 19
Please Someone please I am in the middle of my final year project but this is not working I am trying for 3 days I am new so I don't know how to ask a question so if you need something please ask me Thanks This is the view for Shop and i have used Composer require Hardevine/shoppingcart
This is the ShopComponent for Shop
Upvotes: 1
Views: 11648
Reputation: 3
Remove .prevent
and add type="button"
Example:
<button type="button" wire:click="update()" class="btn btn-success btn-block">Update</button>
Upvotes: 0
Reputation: 1
Your livewire template code should be wrapped inside a single-parent div:
<div>
<!-- Livewire Component Template-->
</div>
Upvotes: 0
Reputation: 656
My solution was based on @KumTem answer
Inside the livewire blades located at app\resources\views\livewire\sample_blade.php
<div id="main">
... templates here
</div>
Upvotes: 0
Reputation: 11
I had same problem. To solve this issue what I did was enclose my blade template files with a <div>
containing an id="main"
like so:
<div id="main">
your blade template code
<div>
Upvotes: 1
Reputation: 11
When I ran Laravel 8
on IIS, I had a similar problem. The problem was that the browser couldn't access some of the livewire js
files, and the solution was:
Go to D:\Projects\Laravel\laravel8ecommerce\vendor\livewire\livewire\config\livewire.php
and set
'asset_url' => "your_url",
and the problem was disappeared.
Upvotes: 1
Reputation: 4449
Instead Of This
wire:click:prevent=“store({{$product->id}},’{{$product->name}}’,{{$product->regular_price}})”
You need to use this in your blade file
@livewireStyles
your code will be in this area
@livewireScripts
Try This For Calling Store Function
wire:click.prevent="store({{$product->id}},{{$product->name}},{{$product->regular_price}})”
Or
wire:click="store({{$product->id}},{{$product->name}},{{$product->regular_price}})”
Upvotes: 0