Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Last active February 20, 2023 14:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save YonatanKra/2284f31412c7a8958f6e16dc691dbda6 to your computer and use it in GitHub Desktop.
Save YonatanKra/2284f31412c7a8958f6e16dc691dbda6 to your computer and use it in GitHub Desktop.
function generateCardContent(question) {
return `
<div slot="main">
<pre>
${question.selector} {
${question.properties.reduce((res, val) => {
return `${res}
${val}:
`
}, '')}
}
</pre>
${question.properties.reduce((res, val) => {
return `
${res}
<vwc-text-field label="${val}" id="${val}"></vwc-text-field>
`
}, '')}
<div style="text-align: center; margin-top: 5px;">
<vwc-button appearance="filled" connotation="cta" onclick="verifyAnswer(${question.id})" label="Submit"></vwc-button>
</div>
</div>
`;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment