js-components-container-panel.md 27.7 KB
Newer Older
Z
zengyawen 已提交
1 2 3 4 5 6 7 8 9 10 11 12
# panel<a name="ZH-CN_TOPIC_0000001127284828"></a>

可滑动面板。提供一种轻量的内容展示的窗口,可方便的在不同尺寸中切换。属于弹出式组件。

## 子组件<a name="section19368335134016"></a>

支持

## 属性<a name="section1100152194018"></a>

除支持[通用属性](js-components-common-attributes.md)外,还支持如下属性:

Z
zengyawen 已提交
13
<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="23.119999999999997%" id="mcps1.1.6.1.1"><p>名称</p>
Z
zengyawen 已提交
14
</th>
Z
zengyawen 已提交
15
<th class="cellrowborder" valign="top" width="23.169999999999998%" id="mcps1.1.6.1.2"><p>类型</p>
Z
zengyawen 已提交
16
</th>
Z
zengyawen 已提交
17
<th class="cellrowborder" valign="top" width="10.59%" id="mcps1.1.6.1.3"><p>默认值</p>
Z
zengyawen 已提交
18
</th>
Z
zengyawen 已提交
19
<th class="cellrowborder" valign="top" width="7.359999999999999%" id="mcps1.1.6.1.4"><p>必填</p>
Z
zengyawen 已提交
20
</th>
Z
zengyawen 已提交
21
<th class="cellrowborder" valign="top" width="35.76%" id="mcps1.1.6.1.5"><p>描述</p>
Z
zengyawen 已提交
22 23 24
</th>
</tr>
</thead>
Z
zengyawen 已提交
25
<tbody><tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>type</p>
Z
zengyawen 已提交
26
</td>
Z
zengyawen 已提交
27
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p>string</p>
Z
zengyawen 已提交
28
</td>
Z
zengyawen 已提交
29
<td class="cellrowborder" valign="top" width="10.59%" headers="mcps1.1.6.1.3 "><p>foldable</p>
Z
zengyawen 已提交
30
</td>
Z
zengyawen 已提交
31
<td class="cellrowborder" valign="top" width="7.359999999999999%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
32
</td>
Z
zengyawen 已提交
33 34 35 36
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>设置可滑动面板类型,不可动态变更,可选值有:</p>
<ul><li><p>minibar:提供minibar和类全屏展示切换效果。</p>
</li><li><p>foldable:内容永久展示类,提供大(类全屏)、中(类半屏)、小三种尺寸展示切换效果。</p>
</li><li><p>temporary:内容临时展示区,提供大(类全屏)、中(类半屏)两种尺寸展示切换效果。</p>
Z
zengyawen 已提交
37 38 39
</li></ul>
</td>
</tr>
Z
zengyawen 已提交
40
<tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>mode</p>
Z
zengyawen 已提交
41
</td>
Z
zengyawen 已提交
42
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p>string</p>
Z
zengyawen 已提交
43
</td>
Z
zengyawen 已提交
44
<td class="cellrowborder" valign="top" width="10.59%" headers="mcps1.1.6.1.3 "><p>full</p>
Z
zengyawen 已提交
45
</td>
Z
zengyawen 已提交
46
<td class="cellrowborder" valign="top" width="7.359999999999999%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
47
</td>
Z
zengyawen 已提交
48 49 50 51
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>设置初始状态,mode参数可选值为:</p>
<ol><li><p>mini:类型为minibar和foldable时,为最小状态;类型为temporary,则不生效。</p>
</li><li><p>half: 类型为foldable和temporary时,为类半屏状态;类型为minibar,则不生效。</p>
</li><li><p>full: 类全屏状态。</p>
Z
zengyawen 已提交
52 53 54
</li></ol>
</td>
</tr>
Z
zengyawen 已提交
55
<tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>dragbar</p>
Z
zengyawen 已提交
56
</td>
Z
zengyawen 已提交
57
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p>boolean</p>
Z
zengyawen 已提交
58
</td>
Z
zengyawen 已提交
59
<td class="cellrowborder" valign="top" width="10.59%" headers="mcps1.1.6.1.3 "><p>true</p>
Z
zengyawen 已提交
60
</td>
Z
zengyawen 已提交
61
<td class="cellrowborder" valign="top" width="7.359999999999999%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
62
</td>
Z
zengyawen 已提交
63
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>设置是否存在dragbar,true表示存在,false表示不存在。</p>
Z
zengyawen 已提交
64 65
</td>
</tr>
Z
zengyawen 已提交
66
<tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>fullheight</p>
Z
zengyawen 已提交
67
</td>
Z
zengyawen 已提交
68
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
69
</td>
Z
zengyawen 已提交
70
<td class="cellrowborder" valign="top" width="10.59%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
71
</td>
Z
zengyawen 已提交
72
<td class="cellrowborder" valign="top" width="7.359999999999999%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
73
</td>
Z
zengyawen 已提交
74
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>指定full状态下的高度,默认为屏幕尺寸 - 8px。</p>
Z
zengyawen 已提交
75 76
</td>
</tr>
Z
zengyawen 已提交
77
<tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>halfheight</p>
Z
zengyawen 已提交
78
</td>
Z
zengyawen 已提交
79
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
80
</td>
Z
zengyawen 已提交
81
<td class="cellrowborder" valign="top" width="10.59%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
82
</td>
Z
zengyawen 已提交
83
<td class="cellrowborder" valign="top" width="7.359999999999999%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
84
</td>
Z
zengyawen 已提交
85
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>指定half状态下的高度,默认为屏幕尺寸的一半。</p>
Z
zengyawen 已提交
86 87
</td>
</tr>
Z
zengyawen 已提交
88
<tr><td class="cellrowborder" valign="top" width="23.119999999999997%" headers="mcps1.1.6.1.1 "><p>miniheight</p>
Z
zengyawen 已提交
89
</td>
Z
zengyawen 已提交
90
<td class="cellrowborder" valign="top" width="23.169999999999998%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
91
</td>
Z
zengyawen 已提交
92
<td class="cellrowborder" valign="top" width="10.59%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
93
</td>
Z
zengyawen 已提交
94
<td class="cellrowborder" valign="top" width="7.359999999999999%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
95
</td>
Z
zengyawen 已提交
96
<td class="cellrowborder" valign="top" width="35.76%" headers="mcps1.1.6.1.5 "><p>指定mini状态下的高度,默认为48px。</p>
Z
zengyawen 已提交
97 98 99 100 101 102 103 104 105 106 107 108 109
</td>
</tr>
</tbody>
</table>

>![](../../public_sys-resources/icon-note.gif) **说明:** 
>-   不支持渲染属性,包括for、if和show。
>-   不支持focusable和disabled属性。

## 样式<a name="section1137118175437"></a>

仅支持如下样式:

Z
zengyawen 已提交
110
<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="23.11768823117688%" id="mcps1.1.6.1.1"><p>名称</p>
Z
zengyawen 已提交
111
</th>
Z
zengyawen 已提交
112
<th class="cellrowborder" valign="top" width="20.477952204779523%" id="mcps1.1.6.1.2"><p>类型</p>
Z
zengyawen 已提交
113
</th>
Z
zengyawen 已提交
114
<th class="cellrowborder" valign="top" width="8.869113088691131%" id="mcps1.1.6.1.3"><p>默认值</p>
Z
zengyawen 已提交
115
</th>
Z
zengyawen 已提交
116
<th class="cellrowborder" valign="top" width="7.519248075192481%" id="mcps1.1.6.1.4"><p>必填</p>
Z
zengyawen 已提交
117
</th>
Z
zengyawen 已提交
118
<th class="cellrowborder" valign="top" width="40.01599840015999%" id="mcps1.1.6.1.5"><p>描述</p>
Z
zengyawen 已提交
119 120 121
</th>
</tr>
</thead>
Z
zengyawen 已提交
122
<tbody><tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>padding</p>
Z
zengyawen 已提交
123
</td>
Z
zengyawen 已提交
124
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
125
</td>
Z
zengyawen 已提交
126
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
127
</td>
Z
zengyawen 已提交
128
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
129
</td>
Z
zengyawen 已提交
130 131 132 133
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><div class="p">该属性可以有1到4个值:<ul><li><p>指定一个值时,该值指定四个边的内边距。</p>
</li><li><p>指定两个值时,第一个值指定上下两边的内边距,第二个指定左右两边的内边距。</p>
</li><li><p>指定三个值时,第一个指定上边的内边距,第二个指定左右两边的内边距,第三个指定下边的内边距。</p>
</li><li><p>指定四个值时分别为上、右、下、左边的内边距(顺时针顺序)。</p>
Z
zengyawen 已提交
134 135 136 137
</li></ul>
</div>
</td>
</tr>
Z
zengyawen 已提交
138
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>padding-[left|top|right|bottom]</p>
Z
zengyawen 已提交
139
</td>
Z
zengyawen 已提交
140
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
141
</td>
Z
zengyawen 已提交
142
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
143
</td>
Z
zengyawen 已提交
144
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
145
</td>
Z
zengyawen 已提交
146
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>设置左、上、右、下内边距属性。</p>
Z
zengyawen 已提交
147 148
</td>
</tr>
Z
zengyawen 已提交
149
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>padding-[start|end]</p>
Z
zengyawen 已提交
150
</td>
Z
zengyawen 已提交
151
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
152
</td>
Z
zengyawen 已提交
153
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
154
</td>
Z
zengyawen 已提交
155
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
156
</td>
Z
zengyawen 已提交
157
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>设置起始和末端内边距属性。</p>
Z
zengyawen 已提交
158 159
</td>
</tr>
Z
zengyawen 已提交
160
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>margin</p>
Z
zengyawen 已提交
161
</td>
Z
zengyawen 已提交
162
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
163
</td>
Z
zengyawen 已提交
164
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
165
</td>
Z
zengyawen 已提交
166
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
167
</td>
Z
zengyawen 已提交
168 169 170 171 172
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>使用简写属性设置所有的外边距属性,该属性可以有1到4个值。</p>
<ul><li><p>只有一个值时,这个值会被指定给全部的四个边。</p>
</li><li><p>两个值时,第一个值被匹配给上和下,第二个值被匹配给左和右。</p>
</li><li><p>三个值时,第一个值被匹配给上, 第二个值被匹配给左和右,第三个值被匹配给下。</p>
</li><li><p>四个值时,会依次按上、右、下、左的顺序匹配 (即顺时针顺序)。</p>
Z
zengyawen 已提交
173 174 175
</li></ul>
</td>
</tr>
Z
zengyawen 已提交
176
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>margin-[left|top|right|bottom]</p>
Z
zengyawen 已提交
177
</td>
Z
zengyawen 已提交
178
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
179
</td>
Z
zengyawen 已提交
180
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
181
</td>
Z
zengyawen 已提交
182
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
183
</td>
Z
zengyawen 已提交
184
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>设置左、上、右、下外边距属性。</p>
Z
zengyawen 已提交
185 186
</td>
</tr>
Z
zengyawen 已提交
187
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>margin-[start|end]</p>
Z
zengyawen 已提交
188
</td>
Z
zengyawen 已提交
189
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
190
</td>
Z
zengyawen 已提交
191
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
192
</td>
Z
zengyawen 已提交
193
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
194
</td>
Z
zengyawen 已提交
195
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>设置起始和末端外边距属性。</p>
Z
zengyawen 已提交
196 197
</td>
</tr>
Z
zengyawen 已提交
198
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border</p>
Z
zengyawen 已提交
199
</td>
Z
zengyawen 已提交
200
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>-</p>
Z
zengyawen 已提交
201
</td>
Z
zengyawen 已提交
202
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
203
</td>
Z
zengyawen 已提交
204
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
205
</td>
Z
zengyawen 已提交
206
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>使用简写属性设置所有的边框属性,包含边框的宽度,样式,颜色属性,顺序设置为border-width、border-style、border-color,不设置时,各属性值为默认值。</p>
Z
zengyawen 已提交
207 208
</td>
</tr>
Z
zengyawen 已提交
209
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-style</p>
Z
zengyawen 已提交
210
</td>
Z
zengyawen 已提交
211
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>string</p>
Z
zengyawen 已提交
212
</td>
Z
zengyawen 已提交
213
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>solid</p>
Z
zengyawen 已提交
214
</td>
Z
zengyawen 已提交
215
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
216
</td>
Z
zengyawen 已提交
217 218 219
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>使用简写属性设置所有边框的样式,可选值为:</p>
<ul><li>dotted:显示为一系列圆点,圆点半径为border-width的一半。</li><li>dashed:显示为一系列短的方形虚线。</li></ul>
<ul><li>solid:显示为一条实线。</li></ul>
Z
zengyawen 已提交
220 221
</td>
</tr>
Z
zengyawen 已提交
222
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-[left|top|right|bottom]-style</p>
Z
zengyawen 已提交
223
</td>
Z
zengyawen 已提交
224
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>string</p>
Z
zengyawen 已提交
225
</td>
Z
zengyawen 已提交
226
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>solid</p>
Z
zengyawen 已提交
227
</td>
Z
zengyawen 已提交
228
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
229
</td>
Z
zengyawen 已提交
230
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>分别设置左、上、右、下四个边框的样式,可选值为dotted、dashed、solid。</p>
Z
zengyawen 已提交
231 232
</td>
</tr>
Z
zengyawen 已提交
233
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-[left|top|right|bottom]</p>
Z
zengyawen 已提交
234
</td>
Z
zengyawen 已提交
235
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>-</p>
Z
zengyawen 已提交
236
</td>
Z
zengyawen 已提交
237
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
238
</td>
Z
zengyawen 已提交
239
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
240
</td>
Z
zengyawen 已提交
241
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>使用简写属性设置对应位置的边框属性,包含边框的宽度,样式,颜色属性,顺序设置为border-width、border-style、border-color,不设置的值为默认值。</p>
Z
zengyawen 已提交
242 243
</td>
</tr>
Z
zengyawen 已提交
244
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-width</p>
Z
zengyawen 已提交
245
</td>
Z
zengyawen 已提交
246
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
247
</td>
Z
zengyawen 已提交
248
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
249
</td>
Z
zengyawen 已提交
250
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
251
</td>
Z
zengyawen 已提交
252
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>使用简写属性设置元素的所有边框宽度<span>,或者单独为各边边框设置宽度</span></p>
Z
zengyawen 已提交
253 254
</td>
</tr>
Z
zengyawen 已提交
255
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-[left|top|right|bottom]-width</p>
Z
zengyawen 已提交
256
</td>
Z
zengyawen 已提交
257
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
258
</td>
Z
zengyawen 已提交
259
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0</p>
Z
zengyawen 已提交
260
</td>
Z
zengyawen 已提交
261
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
262
</td>
Z
zengyawen 已提交
263
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>分别设置左、上、右、下四个边框的宽度。</p>
Z
zengyawen 已提交
264 265
</td>
</tr>
Z
zengyawen 已提交
266
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-color</p>
Z
zengyawen 已提交
267
</td>
Z
zengyawen 已提交
268
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;color&gt;</p>
Z
zengyawen 已提交
269
</td>
Z
zengyawen 已提交
270
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>black</p>
Z
zengyawen 已提交
271
</td>
Z
zengyawen 已提交
272
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
273
</td>
Z
zengyawen 已提交
274
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>使用简写属性设置元素的所有边框颜色<span>,或者单独为各边边框设置颜色</span></p>
Z
zengyawen 已提交
275 276
</td>
</tr>
Z
zengyawen 已提交
277
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-[left|top|right|bottom]-color</p>
Z
zengyawen 已提交
278
</td>
Z
zengyawen 已提交
279
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;color&gt;</p>
Z
zengyawen 已提交
280
</td>
Z
zengyawen 已提交
281
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>black</p>
Z
zengyawen 已提交
282
</td>
Z
zengyawen 已提交
283
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
284
</td>
Z
zengyawen 已提交
285
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>分别设置左、上、右、下四个边框的颜色。</p>
Z
zengyawen 已提交
286 287
</td>
</tr>
Z
zengyawen 已提交
288
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-radius</p>
Z
zengyawen 已提交
289
</td>
Z
zengyawen 已提交
290
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
291
</td>
Z
zengyawen 已提交
292
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
293
</td>
Z
zengyawen 已提交
294
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
295
</td>
Z
zengyawen 已提交
296
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>border-radius属性是设置元素的外边框圆角半径。<span>设置border-radius时不能单独设置某一个方向的border-[left|top|right|bottom]-width,border-[left|top|right|bottom]-color ,如果要设置color和width,需要将四个方向一起设置(border-width、border-color)。</span></p>
Z
zengyawen 已提交
297 298
</td>
</tr>
Z
zengyawen 已提交
299
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>border-[top|bottom]-[left|right]-radius</p>
Z
zengyawen 已提交
300
</td>
Z
zengyawen 已提交
301
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;length&gt;</p>
Z
zengyawen 已提交
302
</td>
Z
zengyawen 已提交
303
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
304
</td>
Z
zengyawen 已提交
305
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
306
</td>
Z
zengyawen 已提交
307
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>分别设置左上,右上,右下和左下四个角的圆角半径。</p>
Z
zengyawen 已提交
308 309
</td>
</tr>
Z
zengyawen 已提交
310
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>background</p>
Z
zengyawen 已提交
311
</td>
Z
zengyawen 已提交
312
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;linear-gradient&gt;</p>
Z
zengyawen 已提交
313
</td>
Z
zengyawen 已提交
314
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
315
</td>
Z
zengyawen 已提交
316
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
317
</td>
Z
zengyawen 已提交
318
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>仅支持设置<a href="js-components-common-gradient.md">渐变样式</a>,与background-color、background-image不兼容。</p>
Z
zengyawen 已提交
319 320
</td>
</tr>
Z
zengyawen 已提交
321
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>background-color</p>
Z
zengyawen 已提交
322
</td>
Z
zengyawen 已提交
323
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>&lt;color&gt;</p>
Z
zengyawen 已提交
324
</td>
Z
zengyawen 已提交
325
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
326
</td>
Z
zengyawen 已提交
327
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
328
</td>
Z
zengyawen 已提交
329
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>设置背景颜色。</p>
Z
zengyawen 已提交
330 331
</td>
</tr>
Z
zengyawen 已提交
332
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>background-image</p>
Z
zengyawen 已提交
333
</td>
Z
zengyawen 已提交
334
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>string</p>
Z
zengyawen 已提交
335
</td>
Z
zengyawen 已提交
336
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>-</p>
Z
zengyawen 已提交
337
</td>
Z
zengyawen 已提交
338
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
339
</td>
Z
zengyawen 已提交
340
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>设置背景图片。与background-color、background不兼容;支持本地图片资源地址。</p>
Z
zengyawen 已提交
341 342
</td>
</tr>
Z
zengyawen 已提交
343
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>background-size</p>
Z
zengyawen 已提交
344
</td>
Z
zengyawen 已提交
345
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><ul><li>string</li><li>&lt;length&gt; &lt;length&gt;</li><li>&lt;percentage&gt; &lt;percentage&gt;</li></ul>
Z
zengyawen 已提交
346
</td>
Z
zengyawen 已提交
347
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>auto</p>
Z
zengyawen 已提交
348
</td>
Z
zengyawen 已提交
349
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
350
</td>
Z
zengyawen 已提交
351 352 353 354
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>设置背景图片的大小。</p>
<ul><li>string可选值:<ul><li>contain:把图像扩展至最大尺寸,以使其高度和宽度完全适用内容区域。</li><li>cover:把背景图像扩展至足够大,以使背景图像完全覆盖背景区域;背景图像的某些部分也许无法显示在背景定位区域中。</li><li>auto:保持原图的比例不变。</li></ul>
</li><li>length值参数方式:<p>设置背景图像的高度和宽度。第一个值设置宽度,第二个值设置高度。如果只设置一个值,则第二个值会被设置为 "auto"。</p>
</li><li>百分比参数方式:<p>以父元素的百分比来设置背景图像的宽度和高度。第一个值设置宽度,第二个值设置高度。如果只设置一个值,则第二个值会被设置为 "auto"。</p>
Z
zengyawen 已提交
355 356 357
</li></ul>
</td>
</tr>
Z
zengyawen 已提交
358
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>background-repeat</p>
Z
zengyawen 已提交
359
</td>
Z
zengyawen 已提交
360
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>string</p>
Z
zengyawen 已提交
361
</td>
Z
zengyawen 已提交
362
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>repeat</p>
Z
zengyawen 已提交
363
</td>
Z
zengyawen 已提交
364
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
365
</td>
Z
zengyawen 已提交
366 367
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>针对重复背景图像样式进行设置,背景图像默认在水平和垂直方向上重复。</p>
<ul><li>repeat:在水平轴和竖直轴上同时重复绘制图片。</li><li>repeat-x:只在水平轴上重复绘制图片。</li><li>repeat-y:只在竖直轴上重复绘制图片。</li><li>no-repeat:不会重复绘制图片。</li></ul>
Z
zengyawen 已提交
368 369
</td>
</tr>
Z
zengyawen 已提交
370
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>background-position</p>
Z
zengyawen 已提交
371
</td>
Z
zengyawen 已提交
372
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><ul><li>string string</li><li>&lt;length&gt; &lt;length&gt;</li><li>&lt;percentage&gt; &lt;percentage&gt;</li></ul>
Z
zengyawen 已提交
373
</td>
Z
zengyawen 已提交
374
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>0px 0px</p>
Z
zengyawen 已提交
375
</td>
Z
zengyawen 已提交
376
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
377
</td>
Z
zengyawen 已提交
378
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><ul><li>关键词方式:如果仅规定了一个关键词,那么第二个值为"center"。两个值分别定义水平方向位置和竖直方向位置。<ul><li>left:水平方向上最左侧。</li><li>right:水平方向上最右侧。</li><li>top:竖直方向上最顶部。</li><li>bottom:竖直方向上最底部。</li><li>center:水平方向或竖直方向上中间位置。</li></ul>
Z
zengyawen 已提交
379
</li></ul>
Z
zengyawen 已提交
380
<ul><li>length值参数方式:第一个值是水平位置,第二个值是垂直位置。 左上角是 0 0。单位是像素 (0px 0px)  。如果仅规定了一个值,另外一个值将是50%。</li><li>百分比参数方式:第一个值是水平位置,第二个值是垂直位置。左上角是 0% 0%。右下角是 100% 100%。如果仅规定了一个值,另外一个值为50%。</li><li>可以混合使用&lt;percentage&gt;&lt;length&gt;</li></ul>
Z
zengyawen 已提交
381 382
</td>
</tr>
Z
zengyawen 已提交
383
<tr><td class="cellrowborder" valign="top" width="23.11768823117688%" headers="mcps1.1.6.1.1 "><p>opacity</p>
Z
zengyawen 已提交
384
</td>
Z
zengyawen 已提交
385
<td class="cellrowborder" valign="top" width="20.477952204779523%" headers="mcps1.1.6.1.2 "><p>number</p>
Z
zengyawen 已提交
386
</td>
Z
zengyawen 已提交
387
<td class="cellrowborder" valign="top" width="8.869113088691131%" headers="mcps1.1.6.1.3 "><p>1</p>
Z
zengyawen 已提交
388
</td>
Z
zengyawen 已提交
389
<td class="cellrowborder" valign="top" width="7.519248075192481%" headers="mcps1.1.6.1.4 "><p></p>
Z
zengyawen 已提交
390
</td>
Z
zengyawen 已提交
391
<td class="cellrowborder" valign="top" width="40.01599840015999%" headers="mcps1.1.6.1.5 "><p>元素的透明度,取值范围为0到1,1表示为不透明,0表示为完全透明。</p>
Z
zengyawen 已提交
392 393 394 395 396 397 398 399 400
</td>
</tr>
</tbody>
</table>

## 事件<a name="section1614413538447"></a>

仅支持如下事件:

Z
zengyawen 已提交
401
<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="24.852485248524854%" id="mcps1.1.4.1.1"><p>名称</p>
Z
zengyawen 已提交
402
</th>
Z
zengyawen 已提交
403
<th class="cellrowborder" valign="top" width="29.552955295529554%" id="mcps1.1.4.1.2"><p>参数</p>
Z
zengyawen 已提交
404
</th>
Z
zengyawen 已提交
405
<th class="cellrowborder" valign="top" width="45.5945594559456%" id="mcps1.1.4.1.3"><p>描述</p>
Z
zengyawen 已提交
406 407 408
</th>
</tr>
</thead>
Z
zengyawen 已提交
409
<tbody><tr><td class="cellrowborder" valign="top" width="24.852485248524854%" headers="mcps1.1.4.1.1 "><p>sizechange</p>
Z
zengyawen 已提交
410
</td>
Z
zengyawen 已提交
411
<td class="cellrowborder" valign="top" width="29.552955295529554%" headers="mcps1.1.4.1.2 "><p>{ size: { height: heightLength, width: widthLength }, mode: modeStr }</p>
Z
zengyawen 已提交
412
</td>
Z
zengyawen 已提交
413 414 415 416 417
<td class="cellrowborder" valign="top" width="45.5945594559456%" headers="mcps1.1.4.1.3 "><p>当可滑动面板发生状态变化时触发,mode参数可选值为:</p>
<ol><li><p>mini:类型为minibar和foldable时,处于最小状态;</p>
</li><li><p>half: 类型为foldable时,处于类半屏状态;</p>
</li><li><p>full: 类全屏状态。</p>
<div class="note"><span class="notetitle"> 说明: </span><div class="notebody"><p>返回的height值为内容区高度值,当dragbar属性为true时,panel本身的高度值为dragbar高度加上内容区高度。</p>
Z
zengyawen 已提交
418 419 420 421 422 423 424 425 426 427 428
</div></div>
</li></ol>
</td>
</tr>
</tbody>
</table>

## 方法<a name="section165301745164719"></a>

仅支持如下方法:

Z
zengyawen 已提交
429
<table><thead align="left"><tr><th class="cellrowborder" valign="top" width="18.459999999999997%" id="mcps1.1.4.1.1"><p>名称</p>
Z
zengyawen 已提交
430
</th>
Z
zengyawen 已提交
431
<th class="cellrowborder" valign="top" width="30.769999999999996%" id="mcps1.1.4.1.2"><p>参数</p>
Z
zengyawen 已提交
432
</th>
Z
zengyawen 已提交
433
<th class="cellrowborder" valign="top" width="50.77%" id="mcps1.1.4.1.3"><p>描述</p>
Z
zengyawen 已提交
434 435 436
</th>
</tr>
</thead>
Z
zengyawen 已提交
437
<tbody><tr><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p>show</p>
Z
zengyawen 已提交
438
</td>
Z
zengyawen 已提交
439
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p>-</p>
Z
zengyawen 已提交
440
</td>
Z
zengyawen 已提交
441
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p>弹出panel可滑动面板。</p>
Z
zengyawen 已提交
442 443
</td>
</tr>
Z
zengyawen 已提交
444
<tr><td class="cellrowborder" valign="top" width="18.459999999999997%" headers="mcps1.1.4.1.1 "><p>close</p>
Z
zengyawen 已提交
445
</td>
Z
zengyawen 已提交
446
<td class="cellrowborder" valign="top" width="30.769999999999996%" headers="mcps1.1.4.1.2 "><p>-</p>
Z
zengyawen 已提交
447
</td>
Z
zengyawen 已提交
448
<td class="cellrowborder" valign="top" width="50.77%" headers="mcps1.1.4.1.3 "><p>关闭panel可滑动面板。</p>
Z
zengyawen 已提交
449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533
</td>
</tr>
</tbody>
</table>

## 示例<a name="section36743614499"></a>

```
<!-- xxx.hml -->
<div class="doc-page">
  <div class="btn-div">
    <button type="capsule" value="Click here" onclick="showPanel"></button>
  </div>
  <panel id="simplepanel" type="foldable" mode="half" onsizechange="changeMode" miniheight="200px">
    <div class="panel-div">
      <div class="inner-txt">
        <text class="txt">Simple panel in {{modeFlag}} mode</text>
      </div>
      <div class="inner-btn">
        <button type="capsule" value="Close" onclick="closePanel"></button>
      </div>
    </div>
  </panel>
</div>
```

```
/* xxx.css */
.doc-page {
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
.btn-div {
  width: 100%;
  height: 200px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.txt {
  color: #000000;
  font-weight: bold;
  font-size: 39px;
}
.panel-div {
  width: 100%;
  flex-direction: column;
  align-items: center;
}
.inner-txt {
  width: 100%;
  height: 160px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.inner-btn {
  width: 100%;
  height: 120px;
  justify-content: center;
  align-items: center;
}
```

```
// xxx.js
export default {
  data: {
    modeFlag: "half"
  },
  showPanel() {
    this.$element('simplepanel').show()
  },
  closePanel() {
    this.$element('simplepanel').close()
  },
  changeMode(e) {
    this.modeFlag = e.mode
  }
}
```

![](figures/panel6.gif)