osb/spark/resources/assets/js/settings/subscription/resume-subscription.js
2017-11-03 16:26:07 +11:00

42 lines
877 B
JavaScript
Vendored

module.exports = {
props: ['user', 'team', 'plans', 'billableType'],
/**
* Load mixins for the component.
*/
mixins: [
require('./../../mixins/plans'),
require('./../../mixins/subscriptions')
],
/**
* Prepare the component.
*/
mounted() {
if (this.onlyHasYearlyPlans) {
this.showYearlyPlans();
}
},
methods: {
/**
* Show the plan details for the given plan.
*
* We'll ask the parent subscription component to display it.
*/
showPlanDetails(plan) {
this.$parent.$emit('showPlanDetails', plan);
},
/**
* Get the plan price with the applicable VAT.
*/
priceWithTax(plan) {
return plan.price + (plan.price * (this.billable.tax_rate / 100));
}
}
};