sks-plugin-el-erp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +10 -0
- package/lib/core.js +33 -0
- package/package.json +18 -0
package/index.js
ADDED
package/lib/core.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 为空或为 null 返回true
|
|
3
|
+
* @param val
|
|
4
|
+
* @return {boolean}
|
|
5
|
+
*/
|
|
6
|
+
export function isNullOrUndefined(val){
|
|
7
|
+
return val === null||val === undefined
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* 字符串不为空
|
|
12
|
+
* @param val
|
|
13
|
+
* @return {boolean}
|
|
14
|
+
*/
|
|
15
|
+
export function strIsEmpty(val){
|
|
16
|
+
return isNullOrUndefined(val)||val===''
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function strIfEmpty(obj, defaultValue=""){
|
|
20
|
+
if(isNullOrUndefined(obj)){
|
|
21
|
+
return defaultValue
|
|
22
|
+
}
|
|
23
|
+
return obj===''?defaultValue:obj
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
//字符串长度
|
|
27
|
+
export function strLength(str){
|
|
28
|
+
if(strIsEmpty(str)){
|
|
29
|
+
return 0
|
|
30
|
+
}
|
|
31
|
+
let tmp=str+''
|
|
32
|
+
return tmp.length
|
|
33
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sks-plugin-el-erp",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "用于erp的element扩展",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "vue-cli-service serve"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://gitee.com/shoukaiseki/sks-plugin-el-erp.git"
|
|
12
|
+
},
|
|
13
|
+
"author": "",
|
|
14
|
+
"license": "ISC",
|
|
15
|
+
"dependencies": {
|
|
16
|
+
"vue": "2.6.12"
|
|
17
|
+
}
|
|
18
|
+
}
|