쿠폰 번호 리스트 - 4자리 마다 하이픈 추가
This commit is contained in:
parent
76909fc232
commit
2ea2421f7c
|
@ -202,7 +202,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.couponNumber="{ item }">
|
<template v-slot:item.couponNumber="{ item }">
|
||||||
{{ item.couponNumber }}
|
{{ formatWithHyphens(item.couponNumber) }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-slot:item.isUsed="{ item }">
|
<template v-slot:item.isUsed="{ item }">
|
||||||
|
@ -431,6 +431,14 @@ export default {
|
||||||
this.coupon_number_count = null
|
this.coupon_number_count = null
|
||||||
},
|
},
|
||||||
|
|
||||||
|
formatWithHyphens(value) {
|
||||||
|
const chunks = [];
|
||||||
|
for (let i = 0; i < value.length; i += 4) {
|
||||||
|
chunks.push(value.substr(i, 4));
|
||||||
|
}
|
||||||
|
return chunks.join('-');
|
||||||
|
},
|
||||||
|
|
||||||
async getCouponList() {
|
async getCouponList() {
|
||||||
this.isLoading = true
|
this.isLoading = true
|
||||||
try {
|
try {
|
||||||
|
|
Loading…
Reference in New Issue