Skip to content

Instantly share code, notes, and snippets.

@IgorHalfeld
Created July 11, 2019 06:51
Show Gist options
  • Save IgorHalfeld/5eacdda94eaae3a4f52af034068ae3a4 to your computer and use it in GitHub Desktop.
Save IgorHalfeld/5eacdda94eaae3a4f52af034068ae3a4 to your computer and use it in GitHub Desktop.
<template functional>
<div
class="container"
:class="{
row: props.flexRow,
column: props.flexColumn,
wrap: props.flexWrap,
'justify-content-start': props.justifyContentStart,
'justify-content-center': props.justifyContentCenter,
'justify-content-end': props.justifyContentEnd,
'align-items-start': props.alignItemsStart,
'align-items-center': props.alignItemsCenter,
'align-items-end': props.alignItemsEnd,
}"
:style="{ ...props.styles }"
>
<slot />
</div>
</template>
<style lang="scss" scoped>
.container { display: flex }
.justify-content-start { justify-content: flex-start }
.justify-content-center { justify-content: center }
.justify-content-end { justify-content: flex-end }
.align-items-start { align-items: flex-start }
.align-items-center { justify-content: center }
.align-items-end { justify-content: flex-end }
.row { flex-direction: row }
.column { flex-direction: column }
.wrap { flex-wrap: wrap }
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment