<dy-toast>
Example
Loading...
<dy-button .color=${"positive"} @click=${()=>customElements.get('dy-toast').open('success', '这是一条消息')}>
Success
</dy-button>
<dy-button .color=${"notice"} @click=${()=>customElements.get('dy-toast').open('warning', '这是一条消息')}>
Warning
</dy-button>
<dy-button .color=${"negative"} @click=${()=>customElements.get('dy-toast').open('error', '这是一条消息')}>
Error
</dy-button>
import { Toast } from 'duoyun-ui/elements/toast';
function onClick() {
Toast.open('success', '这是一条消息');
}
API
DuoyunToastElement
Extends TapToastElement
TapToastElement
Shadow DOM; Extends GemElement
TapToastElement Static Properties
| Property |
Type |
instance |
TapToastElement | undefined |
TapToastElement Static Methods
| Method |
Type |
open |
{ (options: ToastOptions): () => void; (type: Type, content: string | TemplateResult): () => void; } |
TapToastElement Instance Properties
| Property(Attribute) |
Reactive |
Type |
items |
Yes |
ToastItem[] |
TapToastElement Other
| Type |
Value |
| Part |
item, icon, body, action |