-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Open
Description
I think a new computed property should be used to disable/enable the "Remove Item" button.
Instead of checking inStock property, a new inCart property should be used.
The "Remove Item" button should be enabled only if the product id exists in cart - not if it exists in stock!
This is the solution proposed by L10-end:
<button
class="button"
:class="{ disabledButton: !inStock }"
:disabled="!inStock"
@click="removeFromCart">
Remove Item
</button>
<!-- solution -->
This is what I would suggest:
<button
class="button"
:class="{ disabledButton: !inCart }"
:disabled="!inCart"
@click="removeFromCart">
Remove Item
</button>
<!-- solution -->
Metadata
Metadata
Assignees
Labels
No labels