Home > front end >  React development how to dynamically modify antd icon in the menu component values
React development how to dynamically modify antd icon in the menu component values

Time:03-06

The code is:


Want to dynamically assigned to icon
Const userIcon='& lt; TeamOutlined/& gt; '


The results page directly display & lt; TeamOutlined/& gt; Words rather than the corresponding icon, can you tell me how to modify?

CodePudding user response:

It used
Will you try to define a variable TeamOutlined icon image resources assigned to the variable
Then & lt; Menu. The Item key="/user" icon={TeamOutlined} & gt;

CodePudding user response:

Thanks to reply, or not!
  • Related