add table demo
parent
846c2119e3
commit
f1e62240e0
|
@ -132,4 +132,9 @@ import DatePicker from './date-picker'
|
||||||
const { MonthPicker, RangePicker, WeekPicker } = DatePicker
|
const { MonthPicker, RangePicker, WeekPicker } = DatePicker
|
||||||
export { DatePicker, MonthPicker, RangePicker, WeekPicker }
|
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'
|
export { default as version } from './version'
|
||||||
|
|
|
@ -34,3 +34,4 @@ import './steps/style'
|
||||||
import './breadcrumb/style'
|
import './breadcrumb/style'
|
||||||
import './calendar/style'
|
import './calendar/style'
|
||||||
import './date-picker/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 () {
|
render () {
|
||||||
const className = {
|
const className = {
|
||||||
[`${this.props.prefixCls}-row-selected`]: this.selected,
|
[`${this.prefixCls}-row-selected`]: this.selected,
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
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 Radio from '../radio'
|
||||||
import FilterDropdownMenuWrapper from './FilterDropdownMenuWrapper'
|
import FilterDropdownMenuWrapper from './FilterDropdownMenuWrapper'
|
||||||
import { FilterMenuProps } from './interface'
|
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'
|
import BaseMixin from '../_util/BaseMixin'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
|
@ -81,9 +81,9 @@ export const TableRowSelection = {
|
||||||
export const TableProps = {
|
export const TableProps = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
dropdownPrefixCls: 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]),
|
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,
|
dataSource: PropTypes.array,
|
||||||
components: PropTypes.object,
|
components: PropTypes.object,
|
||||||
columns: PropTypes.array,
|
columns: PropTypes.array,
|
||||||
|
@ -178,6 +178,7 @@ export const FilterMenuProps = {
|
||||||
prefixCls: PropTypes.string,
|
prefixCls: PropTypes.string,
|
||||||
dropdownPrefixCls: PropTypes.string,
|
dropdownPrefixCls: PropTypes.string,
|
||||||
getPopupContainer: PropTypes.func,
|
getPopupContainer: PropTypes.func,
|
||||||
|
handleFilter: PropTypes.func,
|
||||||
}
|
}
|
||||||
|
|
||||||
// export interface FilterMenuState {
|
// export interface FilterMenuState {
|
||||||
|
|
|
@ -3,7 +3,7 @@ const AsyncComp = () => {
|
||||||
const hashs = window.location.hash.split('/')
|
const hashs = window.location.hash.split('/')
|
||||||
const d = hashs[hashs.length - 1]
|
const d = hashs[hashs.length - 1]
|
||||||
return {
|
return {
|
||||||
component: import(`../components/vc-table/demo/${d}`),
|
component: import(`../components/table/demo/${d}`),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
export default [
|
export default [
|
||||||
|
|
Loading…
Reference in New Issue