spz-sidebar
Provides a way to display meta content intended for temporary access, such as menus.
布局
Layouts
跳转到“Layouts”Usage
跳转到“Usage”<button type="button" @tap="sidebar.open">Open sidebar</button>
<spz-sidebar id="sidebar" layout="nodisplay" side="left" has-mask>
<button type="button" @tap="sidebar.close">Close sidebar</button>
<ul>
<li>Nav item 1</li>
<li>Nav item 2</li>
<li>Nav item 3</li>
</ul>
</spz-sidebar>
Attributes
跳转到“Attributes”side
跳转到“side”Using a few animations to open the element. It has the following values:
top
: Be opened in fly-from-top animation.left
: Be opened in fly-from-left animation.right
: Be opened in fly-from-right animation.bottom
: Be opened in fly-from-bottom animation.
has-mask
跳转到“has-mask”If this attribute is present, the element will has a mask. The element will be closed when the user clicks 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 element. No parameter required.
close
跳转到“close”close([immediate=<Boolean>])
To close the element.
immediate
: Indicates whether to close the element immediately.
toggle
跳转到“toggle”To toggle open or close the element. No parameter required.
Events
跳转到“Events”sidebarOpen
跳转到“sidebarOpen”Be triggered when the element is opening.
sidebarClose
跳转到“sidebarClose”Be triggered when the element is closing.
<div id="text">Show sidebar</div>
<spz-sidebar
layout="nodisplay"
side="left"
@sidebarOpen="text.toggleClass(class='hidden', force=false);"
@sidebarClose="text.toggleClass(class='hidden', force=true);"
>
<!-- ... -->
</spz-sidebar>