## 一、需要定義組件使用標題:組件XXX使用文檔
## 二、書寫引用組件的代碼
## 三、書寫組件所用到的api ## 四、如果有備注說明需要補充說明
* ## 例子:
> ## 組件hd-login使用文檔
```
<hd-login :loginStyle="loginStyle" ref="hdLogin" :fun="beforeLogin"></hd-login>
```
```
methods: {
async beforeLogin () {
let rest = await this.getUserInfo()
console.log(rest)
if (rest.errcode === 1003) {
return true
} else {
this.$Message.error('獲取用戶信息失敗')
return false
}
}
}
```
### hdLogin props
| 屬性 | 說明 | 類型 | 默認值 |
| --- | --- | --- | --- |
| loginStyle | 對login節點的樣式設置,可以設置背景如backgroundImage: 'url(...)' | Object | default |
| title | 登錄表單的頭名 | String | 歡迎登錄 |
| desc | 登錄描述 | String | 請輸入用戶名密碼 |
| fun | 跳轉首頁之前的處理函數 | Function | 返回true跳轉到首頁,返回false自己處理邏輯|
### hdLogin slot
| 名稱 | 說明 |
| --- | --- |
| default | 默認覆蓋登錄表單框 |
### Table methods
[#](https://www.iviewui.com/components/table#Table_methods)
| 方法名 | 說明 | 參數 |
| --- | --- | --- |
| handleSubmit | 直接調用登錄接口|{username,password}
#### 使用說明:
```
this.$refs.hdLogin.handleSubmit({username,password})
```
#### 備注說明
> 如果使用本地圖片作為背景的圖,可以采用下面的引入圖片方法、
```
import bg from '@/assets/images/login-bg.jpg'
export default {
data () {
return {
loginStyle: {
backgroundImage: 'url(' + bg + ')'
}
}
}
}
```
- 編寫模版
- 模態框 wl-modal
- 富文本框 wl-tinymce
- 國家選擇下拉框 wl-select-country
- 時間軸 wl-timeline
- 國籍選擇下拉框 wl-select-nationality
- 時間及時間段選擇器 wl-timepicker
- 日期及日期段選擇器 wl-datepicker
- 自定義內容下拉框 wl-select-custom
- excel下載組件 wl-down-excel
- 多選框 wl-checkbox
- 多選下拉框 wl-select-mutiple
- 柱狀圖 wl-bar-chart
- 折線圖 wl-line-chart
- 餅圖 wl-pie-chart
- pdf預覽并下載 wl-pdf-download
- excel導入 wl-import-excel
- 生成二維碼 wl-create-qrcode
- 流程預覽 wl-flow-viewer
- 級聯選擇城市 wl-select-city
- 圖片預覽 wl-viewer-show-img
- 業務綜合組件
- 接口管理wl-inter-face-page
- 系統異常微信通知wl-try-catch-notice
- 地圖組件 wl-map