add login keycloak
This commit is contained in:
parent
4b73b98d35
commit
6c3c9384d9
12 changed files with 457 additions and 292 deletions
22
src/plugins/filters.ts
Normal file
22
src/plugins/filters.ts
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/**
|
||||
* GLOABL Filters
|
||||
* - ไฟล์นี้จะไว้เก็บฟังก์ชันง่าย ๆ พวก Helper Functions ทั้งหลาย
|
||||
*/
|
||||
|
||||
|
||||
const filters = {
|
||||
|
||||
/**
|
||||
* ฟังก์ชัน compactNumber ใช้แปลงตัวเลขยาว ๆ ให้กลายเป็นเลขสั้น ๆ แบบที่พวก Social Media ชอบใช้กัน เช่น 1,000 แปลงเป็น 1K หรือ 1,000,000 แปลงเป็น 1M
|
||||
* วิธีใช้ : {{ $filters.compactNumber(value) }}
|
||||
*
|
||||
* @param val รับค่าพารามิเตอร์เป็นตัวแปรชนิดตัวเลข
|
||||
* @returns คืนค่าเป็นตัวเลขที่แปลงค่าแล้ว
|
||||
*/
|
||||
compactNumber (val: number) {
|
||||
const formatter = Intl.NumberFormat('en', { notation: 'compact'})
|
||||
return formatter.format(val)
|
||||
}
|
||||
}
|
||||
|
||||
export default filters;
|
||||
Loading…
Add table
Add a link
Reference in a new issue