Skip to content

Instantly share code, notes, and snippets.

@gpDA
Created September 19, 2021 12:27
Show Gist options
  • Save gpDA/af9375c744782c8e0d831559592ea34a to your computer and use it in GitHub Desktop.
Save gpDA/af9375c744782c8e0d831559592ea34a to your computer and use it in GitHub Desktop.
// want to go over
// 1 - use of functional components
// 2 - dynamic component `component :is`
<template functional>
<header
:class="[
`${props.blockName}__text-head`,
{'gls-download-content__text-head--no-msg':
props.blockName === 'gls-download-content' && !props.commentMessage}]"
>
<component
:is="props.startWithH2 ? 'h2' : 'h1'"
class="text-head__title"
>
{{ props.headerText[0] }}
</component>
<component
:is="props.startWithH2 ? 'h3' : 'h2'"
class="text-head__subtitle"
>
{{ props.headerText[1] }}
</component>
</header>
</template>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment