mirror of
https://github.com/gosticks/react-bootstrap-table2.git
synced 2025-10-16 11:55:39 +00:00
* beautify code block with google-code-prettify * prettyPrint when componentDidMount * css style for code block * skip rule 'no-unresolved' for eslint * conflict with webpack resolve path * refactor all code block in example folder with component <Code /> * refactor scss folder structure * specify the responsibility for each stylesheet with file name * load local color themes, tomorrow, for google code prettify * re-select demo color and save into variable * unify the color system for storybook
35 lines
785 B
JavaScript
35 lines
785 B
JavaScript
import React from 'react';
|
|
|
|
import { BootstrapTable } from 'react-bootstrap-table2';
|
|
import Code from 'common/codeBlock';
|
|
|
|
const columns = [{
|
|
dataField: 'id',
|
|
text: 'Product ID'
|
|
}, {
|
|
dataField: 'name',
|
|
text: 'Product Name'
|
|
}, {
|
|
dataField: 'price',
|
|
text: 'Product Price'
|
|
}];
|
|
|
|
const sourceCode = `\
|
|
<BootstrapTable keyField='id' data={ [] } columns={ columns } noDataIndication="Table is Empty" />
|
|
|
|
// Following is more customizable example
|
|
|
|
function indication() {
|
|
// return something here
|
|
}
|
|
|
|
<BootstrapTable keyField='id' data={ [] } columns={ columns } noDataIndication={ indication } />
|
|
`;
|
|
|
|
export default () => (
|
|
<div>
|
|
<BootstrapTable keyField="id" data={ [] } columns={ columns } noDataIndication="Table is Empty" />
|
|
<Code>{ sourceCode }</Code>
|
|
</div>
|
|
);
|