From e30e26f4a8525e252d6c26754754f90a52af30bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=A5=A5=E6=96=AF?= <9068149@qq.com> Date: Wed, 10 Nov 2021 16:18:14 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96utils?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/componentProperties.js | 3 --- src/utils/index.js | 9 ++------- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/utils/componentProperties.js b/src/utils/componentProperties.js index 3d6b355..b8d0870 100644 --- a/src/utils/componentProperties.js +++ b/src/utils/componentProperties.js @@ -297,15 +297,12 @@ componentsData.set('storenotecard', { moditystyle: 0, // 卡片样式选择 borderRadius: 0, // 图片边角 textWeight: 400, // 标题粗细 - positions: 'left', // 文字位置 noteLabels: true, // 笔记标签 readingNumber: true, // 阅读数 praisePoints: true, //点赞数 viewMore1: true, //更多1 viewMore2: true, //更多2 imageList: [], - purchase: '马上抢', - // eslint-disable-next-line no-dupe-keys positions: 'bottom', //标题位置 linktype: '10', http: {}, diff --git a/src/utils/index.js b/src/utils/index.js index 4a84049..3d534ce 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -57,7 +57,7 @@ class utils { * @returns {boolean} 如果值是数组,则为True,否则为false */ isArray(val) { - Object.prototype.toString.call(val) === '[object Array]' + return Object.prototype.toString.call(val) === '[object Array]' } /** @@ -91,12 +91,7 @@ class utils { // 遍历目标对象 for (let key in obj) { let value = obj[key] - // eslint-disable-next-line no-constant-condition - if (this.getObjClass(value) === 'Object' || 'Array') { - result[key] = this.deepClone(value) - } else { - result[key] = obj[key] - } + result[key] = this.deepClone(value) } return result