我正在尝试制作输入字段(onChange带有道具的方法)。当我输入特定问题 ( string) 时,我会得到答案。我设法为单个字符串做到这一点,但我想多次传递一个字符串数组而不是一个字符串。
const newContent = (props) => {
let questions = '';
if (props.question === "let") {
questions = <p> answer here </p>
} else if (props.question === "var") {
questions = <p> answer here </p>
} else if (props.question === "const") {
questions = <p> answer here </p>
}
let nextQuestion = ["let", "var", "const"];
if (props.question === nextQuestion) {
nextQuestion = <p> answer here </p>
}
}
慕工程0101907
凤凰求蛊
相关分类