试图找出如何获得实际呈现为链接的链接。现在,当我从我的Json文件中读取这行文本后,react将超链接呈现为文本文本,它不会将其呈现为链接。
someData.json
char c = 'a';
char *pChar = new char[26];
for (int i = 0; i < 26; i++, pChar++, c++) {
*pChar = c;
cout << *pChar << flush;
}
delete[] pChar;
someComponent.js
[{
"about": "John has a blog you can read <a href=\"http://www.john.com/blog/\" target=\"_blank\">here</a>."
}]
答案 0 :(得分:2)
<div dangerouslySetInnerHTML={ { __html: company.people.person.about } }></div>
答案 1 :(得分:0)