쿠폰 번호 리스트 - 4자리 마다 하이픈 추가
This commit is contained in:
parent
76909fc232
commit
2ea2421f7c
|
@ -202,7 +202,7 @@
|
|||
</template>
|
||||
|
||||
<template v-slot:item.couponNumber="{ item }">
|
||||
{{ item.couponNumber }}
|
||||
{{ formatWithHyphens(item.couponNumber) }}
|
||||
</template>
|
||||
|
||||
<template v-slot:item.isUsed="{ item }">
|
||||
|
@ -431,6 +431,14 @@ export default {
|
|||
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() {
|
||||
this.isLoading = true
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue