1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-07 18:25:45 +08:00

fix: This is undefined in utils methods. (#965)

This commit is contained in:
Edwin Betancourt 2021-07-07 20:55:52 -04:00 committed by GitHub
parent ef56a8a4f1
commit 3f234ea2b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -163,10 +163,10 @@ export function formatDate(date, isTime = false) {
// Get Formatted Price
export function formatPrice(number, currency) {
if (this.isEmptyValue(number)) {
if (isEmptyValue(number)) {
return undefined
}
if (this.isEmptyValue(currency)) {
if (isEmptyValue(currency)) {
currency = getCurrency()
}
// Get formatted number
@ -178,7 +178,7 @@ export function formatPrice(number, currency) {
// Format Quantity
export function formatQuantity(number) {
if (this.isEmptyValue(number)) {
if (isEmptyValue(number)) {
return undefined
}
if (!Number.isInteger(number)) {
@ -190,7 +190,7 @@ export function formatQuantity(number) {
// Format percentage based on Intl library
export function formatPercent(number) {
if (this.isEmptyValue(number)) {
if (isEmptyValue(number)) {
return undefined
}
// Get formatted number