spz-event
When to Use
- When you need to listen for global events and call the target element's method after the event is triggered.
- When you need to listen for the window's
messageevent, after which the component emits amessageevent.
Code Demonstration
Basic Usage
Calls the specified method of the target element when the listened event is triggered.
Listen to window
Listens to the window element, and when its message event is triggered, the component automatically triggers the message event.
Properties
Events
message
When an element meets the conditions event-name="message" and observer-id="window" and the window's message event is triggered, the component will automatically trigger this event.
- The data of the event object is the native
event.datalistened to.
AI Summary (LLM Ready)
- Component ID:
spz-event - One-line purpose: Listens for events and calls the target element's method when the event is triggered.
- Detected attribute rows: 0
- Detected method subsections: 0
- Detected event subsections: 1
- Top attribute names: none (needs manual completion)
- Top method names: none (needs manual completion)
- Top event names:
message - Reading order: start from usage/examples, then verify attributes, methods, and events.
- Related docs: /en/guide/actions-and-events/ , /en/guide/layouts/