add table demo

pull/165/head
tjz 2018-03-31 21:11:02 +08:00
parent 2052f69f43
commit f65c72f62b
8 changed files with 824 additions and 753 deletions

View File

@ -132,4 +132,9 @@ import DatePicker from './date-picker'
const { MonthPicker, RangePicker, WeekPicker } = DatePicker
export { DatePicker, MonthPicker, RangePicker, WeekPicker }
import Table from './table'
const { Column: TableColumn, ColumnGroup: TableColumnGroup } = Table
export { Table, TableColumn, TableColumnGroup }
export { default as version } from './version'

View File

@ -34,3 +34,4 @@ import './steps/style'
import './breadcrumb/style'
import './calendar/style'
import './date-picker/style'
import './table/style'

File diff suppressed because it is too large Load Diff

View File

@ -44,7 +44,7 @@ export default function createTableRow (Component = 'tr') {
render () {
const className = {
[`${this.props.prefixCls}-row-selected`]: this.selected,
[`${this.prefixCls}-row-selected`]: this.selected,
}
return (

View File

@ -0,0 +1,59 @@
<cn>
#### 基本用法
简单的表格,最后一列是各种操作。
</cn>
<us>
#### basic Usage
Simple table with actions.
</us>
```html
<template>
<a-table :columns="columns" :dataSource="data" />
</template>
<script>
const columns = [{
title: 'Name',
dataIndex: 'name',
key: 'name',
}, {
title: 'Age',
dataIndex: 'age',
key: 'age',
}, {
title: 'Address',
dataIndex: 'address',
key: 'address',
}, {
title: 'Action',
key: 'action',
}];
const data = [{
key: '1',
name: 'John Brown',
age: 32,
address: 'New York No. 1 Lake Park',
}, {
key: '2',
name: 'Jim Green',
age: 42,
address: 'London No. 1 Lake Park',
}, {
key: '3',
name: 'Joe Black',
age: 32,
address: 'Sidney No. 1 Lake Park',
}];
export default {
data() {
return {
data,
columns,
}
}
}
</script>
```

View File

@ -8,7 +8,8 @@ import Checkbox from '../checkbox'
import Radio from '../radio'
import FilterDropdownMenuWrapper from './FilterDropdownMenuWrapper'
import { FilterMenuProps } from './interface'
import { initDefaultProps, cloneElement } from '../_util/props-util'
import { initDefaultProps } from '../_util/props-util'
import { cloneElement } from '../_util/vnode'
import BaseMixin from '../_util/BaseMixin'
export default {

View File

@ -81,9 +81,9 @@ export const TableRowSelection = {
export const TableProps = {
prefixCls: PropTypes.string,
dropdownPrefixCls: PropTypes.string,
rowSelection: PropTypes.shape(TableRowSelection).loose,
rowSelection: PropTypes.oneOfType([PropTypes.shape(TableRowSelection).loose, null]),
pagination: PropTypes.oneOfType([PropTypes.shape(PaginationProps).loose, PropTypes.bool]),
size: PropTypes.oneOf(['default', 'middle', 'small']),
size: PropTypes.oneOf(['default', 'middle', 'small', 'large']),
dataSource: PropTypes.array,
components: PropTypes.object,
columns: PropTypes.array,
@ -178,6 +178,7 @@ export const FilterMenuProps = {
prefixCls: PropTypes.string,
dropdownPrefixCls: PropTypes.string,
getPopupContainer: PropTypes.func,
handleFilter: PropTypes.func,
}
// export interface FilterMenuState {

View File

@ -3,7 +3,7 @@ const AsyncComp = () => {
const hashs = window.location.hash.split('/')
const d = hashs[hashs.length - 1]
return {
component: import(`../components/vc-table/demo/${d}`),
component: import(`../components/table/demo/${d}`),
}
}
export default [