UI toolkit
<skim-cart color="light"></skim-cart>
<script>
const cart = document.querySelector('skim-cart');
cart.addEventListener('click', event => ... );
cart.addEventListener('drop', event => cart.add(id, {
image: image_url,
name,
description,
price,
// etc...
}));
cart.addEventListener('delete', id => ... );
</script>
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
color |
color |
The color of the component | "Danger" \| "Dark" \| "Light" \| "Medium" \| "Success" \| "Warning" \| "primary" \| "secondary" \| "tertiary" |
undefined |
Event | Description | Type |
---|---|---|
cartChange |
Emitted when the items changed | CustomEvent<CartItems> |
delete(key: string) => Promise<void>
Type: Promise<void>
empty() => Promise<void>
Type: Promise<void>
getItems() => Promise<CartItems>
Type: Promise<CartItems>
getQuantity() => Promise<number>
Type: Promise<number>
update(key: string, item: {}, quantity?: number) => Promise<void>
Type: Promise<void>
graph TD;
skim-cart --> ion-button
skim-cart --> ion-icon
skim-cart --> ion-badge
skim-cart --> ion-text
ion-button --> ion-ripple-effect
style skim-cart fill:#f9f,stroke:#333,stroke-width:4px
Built with StencilJS