| | |
| | | |
| | | componentDidMount () { |
| | | const { config } = this.props |
| | | if (config.js && config.wrap.compileMode !== 'custom') { |
| | | if (config.js) { |
| | | try { |
| | | // eslint-disable-next-line no-eval |
| | | eval(config.js) |
| | | // eval(config.js) |
| | | // eslint-disable-next-line |
| | | let evalfunc = eval('(true && function (data) {' + config.js + '})') |
| | | evalfunc([]) |
| | | } catch (e) { |
| | | message.warning(config.name + 'JS 执行失败!') |
| | | console.warn(config.name + e) |
| | |
| | | } |
| | | } |
| | | if (config.html !== nextProps.config.html || config.js !== nextProps.config.js) { |
| | | if (nextProps.config.js && nextProps.config.wrap.compileMode !== 'custom') { |
| | | if (nextProps.config.js) { |
| | | try { |
| | | // eslint-disable-next-line no-eval |
| | | eval(nextProps.config.js) |
| | | let evalfunc = eval('(true && function (data) {' + nextProps.config.js + '})') |
| | | evalfunc([]) |
| | | } catch (e) { |
| | | message.warning(config.name + 'JS 执行失败!') |
| | | console.warn(config.name + e) |