[Improvement] Cell: add center prop (#771)

This commit is contained in:
neverland 2018-03-23 22:46:30 +08:00 committed by GitHub
parent eda842ce07
commit 199ec0cd85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 3 deletions

View File

@ -74,10 +74,11 @@ Vue.use(Cell).use(CellGroup);
| title | Title | `String` | - | - |
| value | Right text | `String` | - | - |
| label | Description below the title | `String` | - | - |
| border | Whether to show inner border | `Boolean` | `true` | - |
| center | Whether to center content vertically | `Boolean` | `true` | - |
| url | Link | `String` | - | - |
| to | Target route of the link, same as to of `vue-router` | `String | Object` | - | - |
| replace | If true, the navigation will not leave a history record | `String` | `false` | - |
| border | Whether to show inner border | `Boolean` | `true` | - |
| clickable | Whether to show click feedback when clicked | `Boolean` | `false` | - |
| is-link | Whether to show link icon | `Boolean` | `false` | - |
| required | Whether to show required mark | `Boolean` | `false` | - |

View File

@ -81,13 +81,14 @@ Vue.use(Cell).use(CellGroup);
| title | 左侧标题 | `String` | - | - |
| value | 右侧内容 | `String` | - | - |
| label | 标题下方的描述信息 | `String` | - | - |
| border | 是否显示内边框 | `Boolean` | `true` | - |
| center | 是否使内容垂直居中 | `Boolean` | `false` | - |
| url | 跳转链接 | `String` | - | - |
| to | 路由跳转对象,同 `vue-router` 的 to | `String | Object` | - | - |
| replace | 跳转时是否替换当前 history | `String` | `false` | - |
| border | 是否显示内边框 | `Boolean` | `true` | - |
| clickable | 是否开启点击反馈 | `Boolean` | `false` | - |
| is-link | 是否展示右侧箭头并开启点击反馈 | `Boolean` | `false` | - |
| required | 是否显示表单必填号 | `Boolean` | `false` | - |
| required | 是否显示表单必填号 | `Boolean` | `false` | - |
### Cell Event

View File

@ -3,6 +3,7 @@
class="van-cell"
:class="{
'van-hairline': border,
'van-cell--center': center,
'van-cell--required': required,
'van-cell--clickable': isLink || clickable
}"
@ -54,6 +55,7 @@ export default create({
icon: String,
title: String,
label: String,
center: Boolean,
isLink: Boolean,
required: Boolean,
clickable: Boolean,