1.0.0 • Published 4 years ago
eastedu-question-select v1.0.0
试题选择/展示
用法
import QuestionSelect from "./QuestionSelect";
export default function App() {
const onQuestionSelect = (e) => {
console.log(e);
};
return data.map((item, index) => (
<QuestionSelect
item={item}
key={index}
questions={[]}
onQuestionSelect={onQuestionSelect}
/>
));
}
参数
// 必选,试题内容
// example: {
// baseInfo: {...},
// question: {...},
// questionSourceDTO: {...},
// chapters: [...],
// knowledge: [...],
// }
item: object,
// 已选试题id数组
// 非必选
// example: ['123','234']
questions: number,
// 勾选试题回调
// 非必选
// example: (id) => {}
onQuestionSelect: function,
// 是否显示答案
// 非必选
// example: true/false
showAnswer: boolean | true,
// 只有移除方法
// 非必选
// example: (id) => {}
justRemove: function,
1.0.0
4 years ago