我有一个数组:
export const options = [
{id: 1, name='ComponentOne'},
{id: 2, name='ComponentTwo'},
]
然后我有我的组件:
export const ComponentOne = props => (<div>{this.props.content}</div>)
export const ComponentTwo = props => (<div>{this.props.content}</div>)
然后我有了我的观点:
export class MyView extends React.Component{
constructor(props){
super(props);
this.state = {};
}
render(){
return(
<div>
{options.map( obj => <obj.name/> )
</div>
)
}
}
我想动态渲染这些组件,但不知道如何。
答案 0 :(得分:1)
不是保留组件类的名称,而是为什么不保留类本身。像这样:
using(PrintDocument pd = new PrintDocument())
{
pd = PreparePrintDocument();
pd.PrinterSettings.PrintFileName =
Application.StartupPath+"\\backup.xps";
pd.PrinterSettings.PrintToFile = true;
pd.PrinterSettings.PrinterName = "XPS";
pd.DefaultPageSettings.PrinterSettings.PrinterName ="Microsoft XPS Document Writer"
pd.Print();
}