xianniu-ui 0.8.0 → 0.8.1
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/lib/xianniu-ui.common.js +45 -24
- package/lib/xianniu-ui.umd.js +45 -24
- package/lib/xianniu-ui.umd.min.js +2 -2
- package/package.json +1 -1
- package/src/utils/utils.js +23 -2
package/package.json
CHANGED
package/src/utils/utils.js
CHANGED
|
@@ -65,7 +65,6 @@ const download = (params = { name: '', url: '' }) => {
|
|
|
65
65
|
name: '下载模板'
|
|
66
66
|
}
|
|
67
67
|
const _params = Object.assign(defaultParams, params)
|
|
68
|
-
console.log('_params: ', _params);
|
|
69
68
|
const { url, name } = _params
|
|
70
69
|
const x = new XMLHttpRequest();
|
|
71
70
|
x.open("GET", url, true);
|
|
@@ -116,10 +115,32 @@ const arrMerge = (arr = [], key = '') => {
|
|
|
116
115
|
}
|
|
117
116
|
return result
|
|
118
117
|
}
|
|
118
|
+
// 判空
|
|
119
|
+
const isBlank = (str) => {
|
|
120
|
+
if (str === null || (!str && str !== 0)) {
|
|
121
|
+
return true
|
|
122
|
+
}
|
|
123
|
+
return false
|
|
124
|
+
}
|
|
125
|
+
/* 重置方法 */
|
|
126
|
+
const reset = (obj) => {
|
|
127
|
+
for (const key in obj) {
|
|
128
|
+
if (Array.isArray(obj[key])) {
|
|
129
|
+
obj[key] = []
|
|
130
|
+
} else if (typeof obj[key] === 'object') {
|
|
131
|
+
obj[key] = reset(obj[key])
|
|
132
|
+
} else {
|
|
133
|
+
obj[key] = ''
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return obj
|
|
137
|
+
}
|
|
119
138
|
export default {
|
|
120
139
|
isEmpty,
|
|
121
140
|
isImg,
|
|
122
141
|
deepClone,
|
|
123
142
|
download,
|
|
124
|
-
arrMerge
|
|
143
|
+
arrMerge,
|
|
144
|
+
reset,
|
|
145
|
+
isBlank
|
|
125
146
|
}
|