# vue-weui组件列表 ## 目录 * [1. 按钮相关](#1-按钮相关) * [ButtonArea](#buttonarea) * [Button](#button) * [2. 列表(Cells)相关](#2-列表cells相关) * [CellsTitle](#cellstitle) * [CellsTips](#cellstips) * [Cells](#cells) * [Cell](#cell) * [LinkCell](#linkcell) * [RadioCell](#radiocell) * [CheckboxCell](#checkboxcell) * [SwitchCell](#switchcell) * [InputCell](#inputcell) * [SelectCell](#selectcell) * [Toptips](#toptips) * [3. 提示框(Toast)相关](#3-提示框toast相关) * [Toast](#toast) * [4. 对话框相关](#4-对话框相关) * [Dialog](#dialog) * [5. 进度条相关](#5-进度条相关) * [Progress](#progress) * [6. 消息页相关](#6-消息页相关) * [Message](#message) * [7. 文章相关](#7-文章相关) * [Article](#article) * [8. 操作菜单相关](#8-操作菜单相关) * [Actionsheet](#actionsheet) * [9. 图标相关](#9-图标相关) * [Icon](#icon) * [10. 九宫格](#10-九宫格) * [Grids](#grids) * [Grid](#grid) * [11. 图片上传](#11-图片上传) * [Uploader](#uploader) * [UploaderFiles](#uploaderfiles) * [UploaderFile](#uploaderfile) * [12. 导航栏](#12-导航栏) * [Tab](#tab) * [Navbar](#navbar) * [Tabbar](#tabbar) * [TabbarItem](#tabbaritem) * [13. 面板(Panel)相关](#13-面板panel相关) * [Panel](#panel) * [PanelHeader](#panelheader) * [PanelBody](#panelbody) * [PanelFooter](#panelfooter) * [14. 组合列表(Media)相关](#14-组合列表media相关) * [MediaBox](#mediabox) * [MediaHeader](#mediaheader) * [MediaBody](#mediabody) * [MediaAppmsgThumb](#MediaAppmsgThumb) * [MediaTitle](#mediatitle) * [MediaDescription](#mediadescription) * [MediaInfo](#mediainfo) * [MediaInfoMeta](#mediainfometa) * [15. 搜索栏](#15-搜索栏) * [SearchBar](#searchbar) ## 组件列表 ### 1. 按钮相关 #### ButtonArea 按钮放置的区域 #### Button 按钮 * props: ```javascript /** * 按钮颜色类型 * primary: 主色 * warn:警告色 * default:默认色(灰色) */ type: { type: String, default: 'primary', required: false }, /** * 是否为disabled按钮,若为true则会阻止点击事件 */ disabled: { type: Boolean, default: false, required: false }, /** * 是否为小按钮 */ mini: { type: Boolean, default: false, required: false }, /** * 是否为plain按钮,plain按钮无填充色,只有边框 * 目前只有primary和default类型支持plain按钮 */ plain: { type: Boolean, default: false, required: false } ``` ### 2. 列表(Cells)相关 列表种类较多,vue-weui做了非常细致的拆分,通过不同组合可以构造丰富的内容。 一些常用结构如下: ```html 标题 列表头 主内容区 说明文字 ... ... ... ... ... ... 底部说明 ``` #### CellsTitle Cells标题 #### CellsTips Cells底部说明文字 #### Cells 可包含多个Cell的容器,Cell需要包含于其中 * props ```javascript /** * Cells类型 * access: 带跳转的列表项容器 * form: 表单容器 * radio: 单选列表项容器 * checkbox: 多选列表项容器 */ type: { type: String, default: '', required: false } ``` #### Cell 一个列表项 * slots * ``: 列表项头部 * ``: 列表项主内容区 * ``: 列表项尾部 * 补充说明 Cell一般用于普通的文本、图标项,若为表单列表项,需使用对应的RadioCell,CheckboxCell,SwitchCell,InputCell或SelectCell #### LinkCell 链接列表项,标签为`` * props ```javascript /** * 跳转链接,若设置则此列表项可点击跳转 */ link: { type: String, required: false }, /** * vue-router使用的跳转链接 * 若使用vue-router,推荐使用router-link而非link */ routerLink: { type: null, required: false } ``` #### RadioCell 单选列表项,其中包含`` * props ```javascript /** * radio input的id */ id: { type: String, required: false }, /** * radio input的name */ name: { type: String, required: false }, /** * radio input的value */ value: { type: String, required: false }, /** * 显示的文本内容 */ label: { type: String, required: true }, /** * 选中项的数据绑定,用于radio input的v-model */ picked: { type: String, required: true, twoWay: true } ``` #### CheckboxCell 单选列表项,其中包含`` * props ```javascript /** * checkbox input的id */ id: { type: String, required: false }, /** * checkbox input的name */ name: { type: String, required: false }, /** * checkbox input的value */ value: { type: String, required: false }, /** * 显示的文本内容 */ label: { type: String, required: true }, /** * 选中项的数据绑定,用于checkbox input的v-model */ checked: { type: null, required: true, twoWay: true } ``` * 补充 单个Checkbox的数据绑定为逻辑值,多个则为数组,具体可参见[表单控件绑定 - vue.js](http://cn.vuejs.org/guide/forms.html#Checkbox) #### SwitchCell 开关列表项,其中包含`` * props ```javascript /** * checkbox input的id */ id: { type: String, required: false }, /** * checkbox input的name */ name: { type: String, required: false }, /** * checkbox input的value */ value: { type: String, required: false }, /** * 显示的文本内容 */ label: { type: String, required: true }, /** * 开关本质上是checkbox,所以此项代表选中项 * 用于checkbox input的v-model */ on: { type: null, required: true, twoWay: true } ``` * 补充 单个Checkbox的数据绑定为逻辑值,多个则为数组,具体可参见[表单控件绑定 - vue.js](http://cn.vuejs.org/guide/forms.html#Checkbox) #### InputCell 文本输入框列表项,包含一个``或`