MCPcopy
hub / github.com/baidu/amis / render

Method render

packages/amis/src/renderers/Alert.tsx:71–100  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

69 Omit<AlertProps, 'actions'> & RendererProps
70> {
71 render() {
72 let {render, body, level, icon, showIcon, actions, ...rest} = this.props;
73 if (isPureVariable(level)) {
74 level = resolveVariableAndFilter(level, this.props.data);
75 }
76 if (isPureVariable(icon)) {
77 icon = resolveVariableAndFilter(icon, this.props.data);
78 }
79 if (isPureVariable(showIcon)) {
80 showIcon = resolveVariableAndFilter(showIcon, this.props.data);
81 }
82
83 const actionsDom: React.ReactNode = actions
84 ? React.isValidElement(actions)
85 ? actions
86 : render('alert-actions', actions)
87 : null;
88
89 return (
90 <Alert
91 {...rest}
92 level={level}
93 icon={icon}
94 showIcon={showIcon}
95 actions={actionsDom}
96 >
97 {render('body', body)}
98 </Alert>
99 );
100 }
101}

Callers

nothing calls this directly

Calls 3

isPureVariableFunction · 0.90
resolveVariableAndFilterFunction · 0.90
renderFunction · 0.85

Tested by

no test coverage detected