is-empty-ls
v1.0.4
Published
判断js数据是否为空
Downloads
1
Readme
Installation
Using npm:
$ npm i is-empty-ls
Vue 中使用示例
import { isEmpty } from 'is-empty-ls'
export default {
mounted() {
let a = ''
console.log(isEmpty(a)) // true
let b = null
console.log(isEmpty(b)) // true
let c = undefined
console.log(isEmpty(c)) // true
let obj1 = {}
console.log(isEmpty(obj1)) // true
let obj2 = { a: 1 }
console.log(isEmpty(obj2)) // false
let arr1 = []
console.log(isEmpty(arr1)) // true
let arr2 = [1]
console.log(isEmpty(arr2)) // false
},
}