Closed contryPresident closed 5 years ago
tinper-bee 版本号:
tinper-bee
"bee-table": "^1.4.21", 这样子引入的import { Row, Table, Pagination} from "tinper-bee";
若使用单个组件,请标明该组件版本号:
当前项目中react的版本号:
react
{ "name": "fe", "version": "1.0.0", "description": "", "main": "webpack.config.js", "scripts": { "build": "cross-env NODE_ENV=production FE_ENV=release uba build", "package": "sh build-docker-image.sh", "mock": "json-server -p 8083 mock-data/db.json --watch", "start": "cross-env NODE_ENV=development FE_ENV=location uba-server", "build:dev": "cross-env NODE_ENV=development FE_ENV=develop uba build", "build:private": "gulp && cross-env NODE_ENV=production FE_ENV=private uba build && node replace.js", "build:core": "cross-env NODE_ENV=production FE_ENV=core uba build && node replace.js", "build:pre": "cross-env NODE_ENV=production FE_ENV=pre uba build", "build:msplatform": "cross-env NODE_ENV=production FE_ENV=ms-platform uba build", "uba-dev": "uba server", "uba-build": "cross-env NODE_ENV=location uba build", "start:pri": "gulp && cross-env NODE_ENV=development FE_ENV=private TOTAL_ENV=location uba-server", "fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit" }, "author": "", "license": "ISC", "dependencies": { "@antv/g6": "^3.0.4", "@antv/hierarchy": "^0.5.0", "antd": "^2.11.1", "babel-plugin-dynamic-import-webpack": "^1.0.2", "babel-runtime": "6.x", "bee-button": "^1.0.6", "bee-button-group": "^2.0.1", "bee-checkbox": "^1.1.0", "bee-collapse": "^1.0.2", "bee-datepicker": "^1.0.35", "bee-dnd": "^1.0.0", "bee-drawer": "0.0.5", "bee-dropdown": "^2.0.10", "bee-form": "2.0.6", "bee-form-control": "^1.1.3", "bee-icon": "^1.0.5", "bee-input-group": "^1.0.7", "bee-input-number": "^2.1.4", "bee-label": "^1.0.0", "bee-layout": "^1.2.7", "bee-loading": "^1.0.3", "bee-loading-state": "^1.0.0", "bee-menu": "^0.1.9", "bee-message": "^1.0.13", "bee-modal": "^2.0.20", "bee-overlay": "^0.2.0", "bee-pagination": "^2.0.8", "bee-popconfirm": "^2.0.0", "bee-popover": "^1.0.6", "bee-radio": "^1.0.3", "bee-rate": "^1.0.3", "bee-search-panel": "^3.0.1", "bee-select": "^1.0.4", "bee-step": "^1.0.2", "bee-switch": "2.0.4", "bee-table": "^1.4.21", "bee-tabs": "^1.0.10", "bee-timeline": "0.0.4", "bee-timepicker": "1.0.1", "bee-tooltip": "^2.1.2", "bee-transfer": "^1.0.6", "bee-tree": "^1.1.4", "bee-tree-select": "^0.0.2", "classnames": "^2.2.5", "component-raf": "^1.2.0", "component-tween": "^1.2.0", "crypto-js": "^3.1.9-1", "d3": "4.10.0", "dagre": "^0.8.4", "echarts": "^3.6.2", "echarts-for-react": "1.1.6", "gg-editor": "2.0.4", "immutable": "^4.0.0-rc.12", "js-base64": "^2.1.9", "js-cookie": "^2.2.0", "marked": "^0.3.6", "mirrorx": "^0.2.10", "moment": "^2.21.0", "postcss-flexbugs-fixes": "^4.1.0", "qs": "^6.4.0", "query-string": "^5.0.1", "rc-calendar": "^8.4.7", "rc-checkbox": "^1.5.0", "rc-slider": "^6.2.0", "rc-tabs": "^7.1.1", "rc-tooltip": "^3.4.2", "react-addons-update": "^15.6.2", "react-cookie": "^2.1.2", "react-custom-scrollbars": "^4.2.1", "react-gojs": "^4.1.0", "react-json-editor-ajrm": "^2.5.9", "react-loadable": "^5.5.0", "react-swipe": "^5.0.6", "yyuap-ref": "^1.1.2" }, "peerDependencies": { "prop-types": "^15.6.0" }, "devDependencies": { "argv": "0.0.2", "autoprefixer": "^7.1.6", "babel-core": "6.26.0", "babel-eslint": "7.x", "babel-loader": "^7.1.2", "babel-plugin-transform-class-properties": "^6.23.0", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "6.x", "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-2": "^6.24.1", "browser-sync": "^2.18.7", "browser-sync-webpack-plugin": "^1.1.4", "clean-webpack-plugin": "^0.1.17", "commitizen": "^2.9.3", "connect-history-api-fallback": "^1.3.0", "conventional-changelog-cli": "1.x", "copy-webpack-plugin": "^4.5.1", "cross-env": "^5.0.0", "css-loader": "^0.28.7", "cssnano": "^4.0.0-rc.2", "cz-conventional-changelog": "^1.2.0", "d3-cloud": "^1.2.4", "ejs-compiled-loader": "^1.1.0", "ejs-loader": "^0.3.0", "es6-promise": "^4.0.5", "eslint": "^4.0.0", "eslint-config-airbnb": "^15.0.1", "eslint-plugin-import": "^2.5.0", "eslint-plugin-jsx-a11y": "^2.2.3", "eslint-plugin-react": "^7.1.0", "extract-text-webpack-plugin": "^2.1.2", "fast-uglifyjs-plugin": "^0.3.0", "file-loader": "^1.1.5", "glob": "^7.1.2", "gulp": "^3.9.1", "gulp-autoprefixer": "^3.1.1", "gulp-concat": "^2.6.1", "happypack": "^3.0.2", "html-webpack-plugin": "^2.30.1", "husky": "^0.12.0", "increase-memory-limit": "^1.0.7", "json-server": "^0.9.5", "less": "^2.7.3", "less-loader": "^4.0.5", "namespace-css-module-loader": "^0.4.1", "open-browser-webpack-plugin": "^0.0.5", "postcss-loader": "^2.0.8", "rc-tree-select": "^1.12.9", "style-loader": "^0.19.0", "uba": "2.2.3-bugfix", "uba-server": "1.0.0-bugfix", "url-loader": "^0.6.2", "validate-commit-msg": "2.x", "webpack-hot-middleware": "^2.21.0", "webpack-jarvis": "^0.2.2", "webpack-merge": "^4.1.1" } }
所使用的操作系统:
所使用的浏览器:
官网样例搬过来的代码出不来效果
import React, { Component } from 'react'; import { Row, Table, Pagination} from "tinper-bee"; import Button from "bee-button"; import Checkbox from 'bee-checkbox'; import Title from "components/Title"; import AppSelect from "../../components/AppSelect"; import multiSelect from "./multiSelect.js"; import './index.less'; let MultiSelectTable = multiSelect(Table, Checkbox); const pageData = { 1: [ { a: "ASVAL_20190328", b: "小张", c: "男", d: "财务二科", e: "M1", key: "1" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "2" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "3" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "4" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "5" }, ], 2: [ { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "9" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "10" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "11" }, { a: "ASVAL_20190312", b: "小红", c: "女", d: "财务一科", e: "T2", key: "12" } ] }; class LogFile extends Component{ constructor(props) { super(props); this.state = { checkedFlag: true, versionList: [{id: 1, name: '1.09'}, {id: 2, name: '2.09'}], selectedVersion: '', envList: [{id: 1, name: 'Local'}, {id: 2, name: 'Dev'}], selectedEnv: '', data: pageData[1], activePage: 1 } } // 勾选按钮事件 getSelectedDataFunc = (selectedList,record,index,newData) => { console.log("selectedList", selectedList,"index",index); // 注意:需要用回调中提供的参数 newData,去更新 state 或 store 中的 data 属性值,否则当表格重新render的时候,已选数据会被冲刷掉。 }; // 行hover事件 getHoverContent=()=>{ return <div className="opt-btns"><Button size="sm" onClick={this.handleClick}>一些操作</Button> </div> } // 分页点击事件 handleSelect(eventKey) { this.setState({ data: pageData[eventKey], activePage: eventKey }); } dataNumSelect = (index, value) => { console.log(index, value); } // 保存 onChange() { this.setState((preval)=>({checkedFlag: !preval.checkedFlag})); }; versionChange({ id, name }) { this.setState({selectedVersion: name}); } envChange({ id, name }) { this.setState({selectedEnv: name}); } render() { const {versionList, selectedVersion, envList, selectedEnv} = this.state; const columns = [ { title: "员工编号", dataIndex: "a", key: "a", }, { title: "员工姓名", dataIndex: "b", key: "b", }, { title: "性别", dataIndex: "c", key: "c", }, { title: "部门", dataIndex: "d", key: "d", }, { title: "职级", dataIndex: "e", key: "e", } ]; const data = [ { a: "ASVAL_20190328", b: "小张", c: "男", d: "财务二科", e: "M1", key: "1" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "2" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "3" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "4" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "5" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "6" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "7" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "8" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "9" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "10" }, { a: "ASVAL_20190320", b: "小明", c: "男", d: "财务一科", e: "T1", key: "11" }, { a: "ASVAL_20190312", b: "小红", c: "女", d: "财务一科", e: "T2", key: "12" } ]; return ( <Row className="confCneterContainer batch-upgrade"> <Title name="日志文件" showBack={false}/> <div className="confCneterContent"> <div className="clearfix margin-top-10"> <Button className="margin-right-10 margin-bottom-20" colors="primary" > 读取 </Button> <Button className="margin-right-10 margin-bottom-20 u-button-border" colors="secondary" > 添加 </Button> <Button className="margin-right-10 margin-bottom-20 u-button-border" colors="secondary" > 删除 </Button> <Button className="margin-right-10 margin-bottom-20 u-button-border" colors="secondary" > 保存 </Button> <Button className="margin-right-10 margin-bottom-20 u-button-border" colors="secondary" > 更新 </Button> <div className="pull-right margin-bottom-20"> <Checkbox // onDoubleClick={ this.handleDblClick } ref="test" inverse checked={this.state.checkedFlag} onChange={this.onChange.bind(this)}> 保存到所有服务器 </Checkbox> </div> </div> <AppSelect versionChange = {this.versionChange.bind(this)} envChange = {this.envChange.bind(this)} versionList = {versionList} selectedVersion = {selectedVersion} envList = {envList} selectedEnv = {selectedEnv} > </AppSelect> <Table columns={columns} data={this.state.data} height={40} hoverContent={this.getHoverContent} // multiSelectConfig={multiObj} //可以自定义 Checkbox 属性 getSelectedDataFunc={this.getSelectedDataFunc} /> <MultiSelectTable columns={columns} data={this.state.data} height={40} hoverContent={this.getHoverContent} // multiSelectConfig={multiObj} //可以自定义 Checkbox 属性 getSelectedDataFunc={this.getSelectedDataFunc}/> <Pagination first last prev next maxButtons={5} boundaryLinks activePage={this.state.activePage} onSelect={this.handleSelect.bind(this)} onDataNumSelect={this.dataNumSelect} showJump={true} total={100} dataNum={1} /> </div> </Row> ) } } export default LogFile;
鼠标 hover 到表格行上的时候,可以截个图
没有反应
这是我测试的版本:
写法没问题,应该是版本太低了。bee-table@2.0.0 之后才增加了 hoverContent 属性,需要升级后使用。
怎么升级?
环境及版本信息
tinper-bee
版本号:"bee-table": "^1.4.21", 这样子引入的import { Row, Table, Pagination} from "tinper-bee";
若使用单个组件,请标明该组件版本号:
当前项目中
react
的版本号:{ "name": "fe", "version": "1.0.0", "description": "", "main": "webpack.config.js", "scripts": { "build": "cross-env NODE_ENV=production FE_ENV=release uba build", "package": "sh build-docker-image.sh", "mock": "json-server -p 8083 mock-data/db.json --watch", "start": "cross-env NODE_ENV=development FE_ENV=location uba-server", "build:dev": "cross-env NODE_ENV=development FE_ENV=develop uba build", "build:private": "gulp && cross-env NODE_ENV=production FE_ENV=private uba build && node replace.js", "build:core": "cross-env NODE_ENV=production FE_ENV=core uba build && node replace.js", "build:pre": "cross-env NODE_ENV=production FE_ENV=pre uba build", "build:msplatform": "cross-env NODE_ENV=production FE_ENV=ms-platform uba build", "uba-dev": "uba server", "uba-build": "cross-env NODE_ENV=location uba build", "start:pri": "gulp && cross-env NODE_ENV=development FE_ENV=private TOTAL_ENV=location uba-server", "fix-memory-limit": "cross-env LIMIT=4096 increase-memory-limit" }, "author": "", "license": "ISC", "dependencies": { "@antv/g6": "^3.0.4", "@antv/hierarchy": "^0.5.0", "antd": "^2.11.1", "babel-plugin-dynamic-import-webpack": "^1.0.2", "babel-runtime": "6.x", "bee-button": "^1.0.6", "bee-button-group": "^2.0.1", "bee-checkbox": "^1.1.0", "bee-collapse": "^1.0.2", "bee-datepicker": "^1.0.35", "bee-dnd": "^1.0.0", "bee-drawer": "0.0.5", "bee-dropdown": "^2.0.10", "bee-form": "2.0.6", "bee-form-control": "^1.1.3", "bee-icon": "^1.0.5", "bee-input-group": "^1.0.7", "bee-input-number": "^2.1.4", "bee-label": "^1.0.0", "bee-layout": "^1.2.7", "bee-loading": "^1.0.3", "bee-loading-state": "^1.0.0", "bee-menu": "^0.1.9", "bee-message": "^1.0.13", "bee-modal": "^2.0.20", "bee-overlay": "^0.2.0", "bee-pagination": "^2.0.8", "bee-popconfirm": "^2.0.0", "bee-popover": "^1.0.6", "bee-radio": "^1.0.3", "bee-rate": "^1.0.3", "bee-search-panel": "^3.0.1", "bee-select": "^1.0.4", "bee-step": "^1.0.2", "bee-switch": "2.0.4", "bee-table": "^1.4.21", "bee-tabs": "^1.0.10", "bee-timeline": "0.0.4", "bee-timepicker": "1.0.1", "bee-tooltip": "^2.1.2", "bee-transfer": "^1.0.6", "bee-tree": "^1.1.4", "bee-tree-select": "^0.0.2", "classnames": "^2.2.5", "component-raf": "^1.2.0", "component-tween": "^1.2.0", "crypto-js": "^3.1.9-1", "d3": "4.10.0", "dagre": "^0.8.4", "echarts": "^3.6.2", "echarts-for-react": "1.1.6", "gg-editor": "2.0.4", "immutable": "^4.0.0-rc.12", "js-base64": "^2.1.9", "js-cookie": "^2.2.0", "marked": "^0.3.6", "mirrorx": "^0.2.10", "moment": "^2.21.0", "postcss-flexbugs-fixes": "^4.1.0", "qs": "^6.4.0", "query-string": "^5.0.1", "rc-calendar": "^8.4.7", "rc-checkbox": "^1.5.0", "rc-slider": "^6.2.0", "rc-tabs": "^7.1.1", "rc-tooltip": "^3.4.2", "react-addons-update": "^15.6.2", "react-cookie": "^2.1.2", "react-custom-scrollbars": "^4.2.1", "react-gojs": "^4.1.0", "react-json-editor-ajrm": "^2.5.9", "react-loadable": "^5.5.0", "react-swipe": "^5.0.6", "yyuap-ref": "^1.1.2" }, "peerDependencies": { "prop-types": "^15.6.0" }, "devDependencies": { "argv": "0.0.2", "autoprefixer": "^7.1.6", "babel-core": "6.26.0", "babel-eslint": "7.x", "babel-loader": "^7.1.2", "babel-plugin-transform-class-properties": "^6.23.0", "babel-plugin-transform-object-rest-spread": "^6.23.0", "babel-plugin-transform-runtime": "6.x", "babel-preset-env": "^1.6.1", "babel-preset-react": "^6.24.1", "babel-preset-stage-2": "^6.24.1", "browser-sync": "^2.18.7", "browser-sync-webpack-plugin": "^1.1.4", "clean-webpack-plugin": "^0.1.17", "commitizen": "^2.9.3", "connect-history-api-fallback": "^1.3.0", "conventional-changelog-cli": "1.x", "copy-webpack-plugin": "^4.5.1", "cross-env": "^5.0.0", "css-loader": "^0.28.7", "cssnano": "^4.0.0-rc.2", "cz-conventional-changelog": "^1.2.0", "d3-cloud": "^1.2.4", "ejs-compiled-loader": "^1.1.0", "ejs-loader": "^0.3.0", "es6-promise": "^4.0.5", "eslint": "^4.0.0", "eslint-config-airbnb": "^15.0.1", "eslint-plugin-import": "^2.5.0", "eslint-plugin-jsx-a11y": "^2.2.3", "eslint-plugin-react": "^7.1.0", "extract-text-webpack-plugin": "^2.1.2", "fast-uglifyjs-plugin": "^0.3.0", "file-loader": "^1.1.5", "glob": "^7.1.2", "gulp": "^3.9.1", "gulp-autoprefixer": "^3.1.1", "gulp-concat": "^2.6.1", "happypack": "^3.0.2", "html-webpack-plugin": "^2.30.1", "husky": "^0.12.0", "increase-memory-limit": "^1.0.7", "json-server": "^0.9.5", "less": "^2.7.3", "less-loader": "^4.0.5", "namespace-css-module-loader": "^0.4.1", "open-browser-webpack-plugin": "^0.0.5", "postcss-loader": "^2.0.8", "rc-tree-select": "^1.12.9", "style-loader": "^0.19.0", "uba": "2.2.3-bugfix", "uba-server": "1.0.0-bugfix", "url-loader": "^0.6.2", "validate-commit-msg": "2.x", "webpack-hot-middleware": "^2.21.0", "webpack-jarvis": "^0.2.2", "webpack-merge": "^4.1.1" } }
所使用的操作系统:
所使用的浏览器:
您所在的领域、行业或项目组:
描述这个问题:
官网样例搬过来的代码出不来效果
1、代码
2、报错信息
当前的行为:效果(可截图说明)及动作描述
期望的行为: