add table demo
parent
2052f69f43
commit
f65c72f62b
|
@ -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'
|
||||
|
|
|
@ -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
|
@ -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 (
|
||||
|
|
|
@ -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>
|
||||
```
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 [
|
||||
|
|
Loading…
Reference in New Issue