UNPKG

epmp-cli

Version:

A simple init for epm scaffolding projects.

59 lines (50 loc) 1.42 kB
/* * @Description: * @Version: 2.0 * @Date: 2022-02-22 15:51:32 * @LastEditTime: 2022-04-08 13:45:29 */ /** * @file 控件示例模板 * @author liuyzhm * @date 2020.12.16 */ import './index.less'; import ReactDOM from 'react-dom'; import React, { Component } from 'react'; const { createPage, base } = window.$lightappFront; import * as API from './api'; import * as Events from './events'; import { PAGE_CONST } from './constant'; import initTemplate from './initTemplate'; const { NCButton } = base; class Demo extends Component { constructor(props) { super(props); } componentDidMount() { initTemplate.call(this); } render() { let { editTable } = this.props; let { createEditTable } = editTable; return ( <div className='demo-wrapper'> <div className='button-area'> <NCButton onClick={API.setTableData.bind(this)}>设置表格数据</NCButton> </div> {createEditTable(PAGE_CONST.table_id, { showCheck: true, // 显示复选框 showIndex: true, // 显示序号列 isAddRow: false, // 失去焦点是否自动增行 showPagination: true, cancelCustomRightMenu: true, adaptionHeight: true, //自适应高度 onBeforeEvent: Events.onBeforeEvent.bind(this), })} </div> ); } } Demo = createPage({})(Demo); ReactDOM.render(<Demo />, document.querySelector('#app'));