opnform-host-nginx/client/components/pages/pricing/MonthlyYearlySelector.vue

41 lines
1010 B
Vue
Raw Normal View History

2023-12-09 15:47:03 +01:00
<template>
<div class="border border-gray-300 rounded-xl flex p-1 relative">
<button class="font-semibold block flex-grow cursor-pointer">
<div
class="p-2 px-3 rounded-lg transition-colors"
:class="{ 'bg-blue-500 text-white': !modelValue }"
2023-12-09 15:47:03 +01:00
@click="set(false)"
>
Monthly
</div>
</button>
<button
class="font-semibold block flex-grow cursor-pointer"
@click="set(true)"
>
2023-12-09 15:47:03 +01:00
<div
class="p-2 px-4 rounded-lg transition-colors"
:class="{ 'bg-blue-500 text-white': modelValue }"
2023-12-09 15:47:03 +01:00
>
Yearly
</div>
</button>
<div class="absolute hidden sm:block text-gray-500 text-xs mt-12">
Save 20% with annual plans
</div>
</div>
</template>
<script setup>
import { defineEmits, defineProps } from "vue"
2023-12-09 15:47:03 +01:00
defineProps({
modelValue: { type: Boolean, required: true },
2023-12-09 15:47:03 +01:00
})
const emit = defineEmits(['update:modelValue'])
2023-12-09 15:47:03 +01:00
const set = (value) => {
emit("update:modelValue", value)
2023-12-09 15:47:03 +01:00
}
</script>