mirror of
https://github.com/ArthurDanjou/website-old.git
synced 2026-01-25 01:10:38 +01:00
💻 | Working so hard on the design review
This commit is contained in:
41
src/components/Ad.vue
Normal file
41
src/components/Ad.vue
Normal file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div class="rounded-3xl p-12 text-center shadow-md" :class="getColor">
|
||||
<slot />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {computed} from "@nuxtjs/composition-api";
|
||||
|
||||
interface AdProps {
|
||||
color: string
|
||||
}
|
||||
|
||||
export default {
|
||||
name: "Ad",
|
||||
props: {
|
||||
color: {
|
||||
type: String,
|
||||
default: 'red'
|
||||
}
|
||||
},
|
||||
setup(props: AdProps) {
|
||||
const getColor = computed(() => {
|
||||
switch (props.color) {
|
||||
case 'red':
|
||||
return 'bg-red-300'
|
||||
case 'blue':
|
||||
return 'bg-blue-300'
|
||||
}
|
||||
})
|
||||
|
||||
return {
|
||||
getColor
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user