We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 077cff4 + a14ba5e commit f64832fCopy full SHA for f64832f
src/components/Answer/index.jsx
@@ -4,6 +4,14 @@ import Details from "@theme/Details";
4
/**
5
* component that hide an answer
6
*/
7
-export default function Answer({ children }) {
8
- return <Details summary={<summary>解答</summary>}>{children}</Details>;
+export default function Answer({ type = undefined, children }) {
+ return (
9
+ <Details
10
+ summary={
11
+ type ? <summary>解答例: {type}</summary> : <summary>解答例</summary>
12
+ }
13
+ >
14
+ {children}
15
+ </Details>
16
+ );
17
}
0 commit comments