uview-plus 3.1.37 → 3.1.38
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/changelog.md
CHANGED
package/libs/function/index.js
CHANGED
|
@@ -170,9 +170,9 @@ function addStyle(customStyle, target = 'object') {
|
|
|
170
170
|
* @param {string|number} value 需要添加单位的值
|
|
171
171
|
* @param {string} unit 添加的单位名 比如px
|
|
172
172
|
*/
|
|
173
|
-
function addUnit(value = 'auto', unit = '') {
|
|
174
|
-
if (!unit) {
|
|
175
|
-
unit = uni.$u.config.unit || 'px'
|
|
173
|
+
function addUnit(value = 'auto', unit = '') {
|
|
174
|
+
if (!unit) {
|
|
175
|
+
unit = uni.$u.config.unit || 'px'
|
|
176
176
|
}
|
|
177
177
|
value = String(value)
|
|
178
178
|
// 用uView内置验证规则中的number判断是否为数值
|
|
@@ -212,7 +212,9 @@ function deepMerge(target = {}, source = {}) {
|
|
|
212
212
|
for (const prop in source) {
|
|
213
213
|
if (!source.hasOwnProperty(prop)) continue
|
|
214
214
|
if (prop in target) {
|
|
215
|
-
if (
|
|
215
|
+
if (source[prop] == null) {
|
|
216
|
+
target[prop] = source[prop]
|
|
217
|
+
}else if (typeof target[prop] !== 'object') {
|
|
216
218
|
target[prop] = source[prop]
|
|
217
219
|
} else if (typeof source[prop] !== 'object') {
|
|
218
220
|
target[prop] = source[prop]
|