Skip to content

Commit

Permalink
Vue reformat.
Browse files Browse the repository at this point in the history
  • Loading branch information
janbarasek committed Apr 27, 2022
1 parent f7f88cc commit acdaaa8
Showing 1 changed file with 35 additions and 35 deletions.
70 changes: 35 additions & 35 deletions templates/default.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Vue.component("cms-cart-voucher-default", {
template: `<div class="container-fluid">
Vue.component('cms-cart-voucher-default', {
template: `<div class="container-fluid">
<div class="row mt-2">
<div class="col">
<h1>Voucher manager</h1>
Expand Down Expand Up @@ -66,37 +66,37 @@ Vue.component("cms-cart-voucher-default", {
<label class="w-100">Valid to:<b-form-datepicker v-model="form.validTo" /></label>
</b-modal>
</div>`,
data() {
return {
feed: null,
types: [],
form: {
code: "",
type: "",
value: "",
percentage: "",
usageLimit: "",
mustBeUnique: "",
note: "",
validFrom: "",
validTo: "",
},
};
},
created() {
this.sync();
},
methods: {
sync() {
axiosApi.get("cart-voucher").then((req) => {
this.feed = req.data.feed;
this.types = req.data.types;
});
},
generateRandomCode() {
axiosApi.get("cart-voucher/generate-random-code").then((req) => {
this.form.code = req.data.code;
});
},
},
data() {
return {
feed: null,
types: [],
form: {
code: '',
type: '',
value: '',
percentage: '',
usageLimit: '',
mustBeUnique: '',
note: '',
validFrom: '',
validTo: '',
},
};
},
created() {
this.sync();
},
methods: {
sync() {
axiosApi.get('cart-voucher').then((req) => {
this.feed = req.data.feed;
this.types = req.data.types;
});
},
generateRandomCode() {
axiosApi.get('cart-voucher/generate-random-code').then((req) => {
this.form.code = req.data.code;
});
},
},
});

0 comments on commit acdaaa8

Please sign in to comment.