spz-lightbox
布局
Layouts
跳转到“Layouts”Usage
跳转到“Usage”In the following code, use buttons to open
and close
the lightbox.
<spz-lightbox id="lightbox" layout="nodisplay" has-mask>
<header>Header</header>
<main>
<h3>Content</h3>
</main>
<footer>Footer</footer>
<button type="button" @tap="lightbox.close();">Close lightbox</button>
</spz-lightbox>
<button type="button" @tap="lightbox.open();">Open lightbox</button>
Attributes
跳转到“Attributes”animate-in
跳转到“animate-in”Using a few animations to open the lightbox. It has the following values:
fade-in
: default Be opened in fade-in and fade-out animation.fly-in-bottom
: Be opened in fly-from-bottom animation.fly-in-top
: Be opened in fly-from-top animation.
top
跳转到“top”A number less than 100. Used to set the y-axis distance of the element in the parent element。
left
跳转到“left”A number less than 100. Used to set the x-axis distance of the element in the parent element。
scrollable
跳转到“scrollable”adsorption
跳转到“adsorption”If this attribute is present, before the element is opened, it will calculate whether to open up or down. Often used to implement drop-down lists.
unclose-in-focus
跳转到“unclose-in-focus”If this attribute is present, the element will not be closed when it is not focused.
unmount
跳转到“unmount”If this attribute is present, when the lightbox is closed, its inner elements will unmount.
has-mask
跳转到“has-mask”If this attribute is present, the element will show a mask. The element will be closed when the user clicks or taps the mask.
mask-id
跳转到“mask-id”A string of the HTML DOM ID. It specifies which element the mask is placed under.
Actions
跳转到“Actions”open
跳转到“open”To open the lightbox. No parameter required.
close
跳转到“close”To close the lightbox. No parameter required.
Events
跳转到“Events”lightboxOpen
跳转到“lightboxOpen”Be automatically triggered when the lightbox opens.
lightboxClose
跳转到“lightboxClose”Be automatically triggered when the lightbox closes.