MCPcopy Create free account
hub / github.com/sshwsfc/xadmin / constructor

Function constructor

xadmin-dashboard/src/components/Cell.js:91–109  ·  view source on GitHub ↗
(props, context)

Source from the content-addressed store, hash-verified

89export default class Cell extends React.Component {
90
91 constructor(props, context) {
92 super(props, context)
93 const { cellKey, editMode, data, cells, params } = props
94 const widgetParams = convertData(data, params, editMode)
95
96 let display = true
97 if(!editMode && widgetParams['__display__']) {
98 display = eval(widgetParams['__display__'])
99 }
100
101 // 初始化不会跟随data改变而改变的东西
102 this.state = {
103 hasError: false,
104 childrenCells: (params.childrenCells || []).map(key => cells[key]),
105 events: this.getEvents(params.events),
106 widgetParams,
107 display, widgetDisplay: display
108 }
109 }
110
111 componentWillReceiveProps(nextProps) {
112 const newState = {}

Callers

nothing calls this directly

Calls 1

mapMethod · 0.80

Tested by

no test coverage detected