# Panel 面板

### 引入

在`index.config.js中引入组件

```json
"usingComponents": {
  "van-panel": "@vant/weapp/panel/index"
}
```

## 代码演示

### 基础用法

面板只是一个容器，里面可以放入自定义的内容

```html
<van-panel title="标题" desc="描述信息" status="状态">
  <view>内容</view>
</van-panel>
```

### 高级用法

使用`slot`自定义内容

```html
  <van-panel title="标题" desc="描述信息" status="状态" useFooterSlot={true}>
            <view class="content">内容</view>
            <view slot="footer" class="footer">
              <van-button size="small" class="demo-margin-right">按钮</van-button>
              <van-button size="small" type="danger">按钮</van-button>
            </view>
  </van-panel>
```

## API
### 注:属性应用在组件上需要统一使用驼峰式命名，如custom-class应变为
```html
<van-button type="primary" customClass='myClass' size="large">大号按钮</van-button>
```
### 注:事件应用在组件上需要统一使用驼峰式命名，如bind:click/bind:search/bind:before-enter应变为
```html
<van-button type="primary" onClick={()=>this.onClick()}>大号按钮</van-button>
<van-search type="primary" onSearch={()=>this.onSearch()}>大号按钮</van-search>
<van-transition type="primary" onBeforeEnter={()=>this.onBeforeEnter()}>大号按钮</van-transition>
```
### Props

| 参数            | 说明                 | 类型      | 默认值  | 版本 |
| --------------- | -------------------- | --------- | ------- | ---- |
| title           | 标题                 | _string_  | -       | -    |
| desc            | 描述                 | _string_  | -       | -    |
| status          | 状态                 | _string_  | -       | -    |
| use-footer-slot | 是否使用 footer slot | _boolean_ | `false` | -    |

### Slot

| 名称   | 说明                                                           |
| ------ | -------------------------------------------------------------- |
| -      | 自定义内容                                                     |
| header | 自定义 header，如果设置了`title`、`desc`、`status`属性则不生效 |
| footer | 自定义 footer，需要设置 `use-footer-slot`属性                  |

### 外部样式类

| 类名         | 说明         |
| ------------ | ------------ |
| custom-class | 根节点样式类 |
| header-class | 头部样式类   |
| footer-class | 底部样式类   |
