쿠폰 번호 리스트 - 4자리 마다 하이픈 추가
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user