I'm currently exploring a new project and attempting to design a toggle that switches between monthly and annual payments based on the user's selection, much like the functionality found here: .
At present, I have implemented two sets of price cards in my layout. However, I am facing challenges in connecting the toggles to ensure they function correctly. This project is built using Vue.js.
Any assistance or guidance on this matter would be greatly appreciated.
Below is the code snippet I am currently working with:
<div class="container">
<label for="toggle_button">
<span v-if="isActive" class="toggle__label">Monthly</span>
<span v-if="! isActive" class="toggle__label">Annually</span>
<input type="checkbox" id="toggle_button" v-model="checkedValue">
<span class="toggle__switch"></span>
</label>
<b-row class="monthly">
<b-col>
<b-card class="price-card">
<template #header>
<h4 class="mb-0 content-center title-colour">Search4Less</h4>
</template>
<b-card-body>
<b-card-sub-title class="mb-2 content-center">€20<small style="font-size:10px">/per user</small></b-card-sub-title>
<hr class="my-4">
<b-card-text class="content-center">
Limitless access Irish business<br>
Intelligence Information.
</b-card-text>
<b-card-text class="small-text"><small style="font-size:14px;">(includes)</small></b-card-text>
</b-card-body>
<b-list-group class="content-center" flush>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>Company Reports</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>Director Reports</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>Business Reports</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>CRO Filings</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>Watchlist</b-list-group-item>
</b-list-group>
<hr class="my-4">
<div style="text-align:center;">
<b-button variant="success">Subscribe Now</b-button>
</div>
</b-card>
</b-col>
<b-col>
<b-card class="price-card">
<template #header>
<h4 class="mb-0 content-center title-colour">Search4Less Plus</h4>
</template>
<b-card-body>
<b-card-sub-title class="mb-2 content-center">€25<small style="font-size:10px">/per user</small></b-card-sub-title>
<hr class="my-4">
<b-card-text class="content-center">
All of the Search4less features +<br>
any 1 of the following
</b-card-text>
<b-card-text class="small-text"><small style="font-size:14px">(any one)</small></b-card-text>
</b-card-body>
<b-list-group flush class="content-center">
<b-list-group-item><i class="fas fa-check" style="color:green"></i>UK Data Access</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Export Bundle</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Due Dil Reports</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Document Search</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Enhanced Watchlist</b-list-group-item>
</b-list-group>
<hr class="my-4">
<div style="text-align:center">
<b-button variant="success">Subscribe Now</b-button>
</div>
</b-card>
</b-col>
<b-col>
<b-card class="price-card">
<template #header>
<h4 class="mb-0 content-center title-colour">Search4Less Pro</h4>
</template>
<b-card-body>
<b-card-sub-title class="mb-2 content-center price-colour">€30<small style="font-size:10px">/per user</small></b-card-sub-title>
<hr class="my-4">
<b-card-text class="content-center">
All of the Search4less and<br>
Search4less plus features.
</b-card-text>
<b-card-text class="small-text"><small style="font-size:14px">(best value)</small></b-card-text>
</b-card-body>
<b-list-group class="content-center" flush>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>More Data sets</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>All Features</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>Saves time</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>Relevant Results</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green;"></i>Better Insights</b-list-group-item>
</b-list-group>
<hr class="my-4">
<div style="text-align:center">
<b-button variant="success">Subscribe Now</b-button>
</div>
</b-card>
</b-col>
</b-row>
</div>
<b-row class="annually" hidden>
<b-col>
<b-card class="price-card">
<template #header>
<h4 class="mb-0 content-center title-colour">Search4Less</h4>
</template>
<b-card-body>
<b-card-sub-title class="mb-2 content-center">€195<small style="font-size:10px">/per user p/a</small></b-card-sub-title>
<hr class="my-4">
<b-card-text class="content-center">
Limitless access Irish business<br> Intelligence Information.
</b-card-text>
<b-card-text class="small-text"><small style="font-size:14px">(includes)</small></b-card-text>
</b-card-body>
<b-list-group class="content-center" flush>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Company Reports</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Director Reports</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Business Reports</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>CRO Filings</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Watchlist</b-list-group-item>
</b-list-group>
<hr class="my-4">
<div style="text-align:center">
<b-button variant="success">Start Trial Now</b-button>
<b-button variant="success">Subscribe Now</b-button>
</div>
</b-card>
</b-col>
<b-col>
<b-card class="price-card">
<template #header>
<h4 class="mb-0 content-center title-colour">Search4Less Plus</h4>
</template>
<b-card-body>
<b-card-sub-title class="mb-2 content-center">€245<small style="font-size:10px">/per user p/a</small></b-card-sub-title>
<hr class="my-4">
<b-card-text class="content-center">
All of the Search4less features +<br>
any 1 of the following
</b-card-text>
<b-card-text class="small-text"><small style="font-size:14px">(any one)</small></b-card-text>
</b-card-body>
<b-list-group flush class="content-center">
<b-list-group-item><i class="fas fa-check" style="color:green"></i>UK Data Access</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Export Bundle</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Due Dil Reports</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Document Search</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Enhanced Watchlist</b-list-group-item>
</b-list-group>
<hr class="my-4">
<div style="text-align:center">
<b-button variant="success">Start Trial Now</b-button>
<b-button variant="success">Subscribe Now</b-button>
</div>
</b-card>
</b-col>
<b-col>
<b-card class="price-card">
<template #header>
<h4 class="mb-0 content-center title-colour">Search4Less Pro</h4>
</template>
<b-card-body>
<b-card-sub-title class="mb-2 content-center price-colour">€295<small style="font-size:10px">/per user p/a</small></b-card-sub-title>
<hr class="my-4">
<b-card-text class="content-center">
All of the Search4less and<br>
Search4less plus features.
</b-card-text>
<b-card-text class="small-text"><small style="font-size:14px">(best value)</small></b-card-text>
</b-card-body>
<b-list-group class="content-center" flush>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>More Data sets</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>All Features</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Saves time</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Relevant Results</b-list-group-item>
<b-list-group-item><i class="fas fa-check" style="color:green"></i>Better Insights</b-list-group-item>
</b-list-group>
<hr class="my-4">
<div style="text-align:center">
<b-button variant="success">Start Trial Now</b-button>
<b-button variant="success">Subscribe Now</b-button>
</div>
</b-card>
</b-col>
</b-row>
</body>
</div>
</template>
<script>
export default {
name: 'Pricing',
data() {
return {
currentState: false
}
},
computed: {
isActive() {
return this.currentState;
},
checkedValue: {
get() {
return this.defaultState
},
set(newValue) {
this.currentState = newValue;
}
}
}
}