mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-30 03:02:49 +08:00
refactor: change if...else to ternary operator
This commit is contained in:
parent
862fa88e99
commit
617faf7052
@ -1,9 +1,2 @@
|
||||
exports.notEmpty = name => {
|
||||
return v => {
|
||||
if (!v || v.trim() === '') {
|
||||
return `${name} is required`
|
||||
} else {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.notEmpty = name => v =>
|
||||
!v || v.trim() === '' ? `${name} is required` : true
|
||||
|
Loading…
x
Reference in New Issue
Block a user