discourse-subscriptions/assets/javascripts/discourse/components/payment-options.js.es6

16 lines
333 B
JavaScript

import Component from "@ember/component";
export default Component.extend({
didInsertElement() {
this._super(...arguments);
if (this.plans && this.plans.length === 1) {
this.set("selectedPlan", this.plans[0].id);
}
},
actions: {
clickPlan(plan) {
this.set("selectedPlan", plan.id);
},
},
});