mirror of
https://gitee.com/was666/as-editor.git
synced 2025-02-23 18:42:55 +08:00
feat: 优化utils
This commit is contained in:
parent
a321bf358f
commit
e30e26f4a8
@ -297,15 +297,12 @@ componentsData.set('storenotecard', {
|
|||||||
moditystyle: 0, // 卡片样式选择
|
moditystyle: 0, // 卡片样式选择
|
||||||
borderRadius: 0, // 图片边角
|
borderRadius: 0, // 图片边角
|
||||||
textWeight: 400, // 标题粗细
|
textWeight: 400, // 标题粗细
|
||||||
positions: 'left', // 文字位置
|
|
||||||
noteLabels: true, // 笔记标签
|
noteLabels: true, // 笔记标签
|
||||||
readingNumber: true, // 阅读数
|
readingNumber: true, // 阅读数
|
||||||
praisePoints: true, //点赞数
|
praisePoints: true, //点赞数
|
||||||
viewMore1: true, //更多1
|
viewMore1: true, //更多1
|
||||||
viewMore2: true, //更多2
|
viewMore2: true, //更多2
|
||||||
imageList: [],
|
imageList: [],
|
||||||
purchase: '马上抢',
|
|
||||||
// eslint-disable-next-line no-dupe-keys
|
|
||||||
positions: 'bottom', //标题位置
|
positions: 'bottom', //标题位置
|
||||||
linktype: '10',
|
linktype: '10',
|
||||||
http: {},
|
http: {},
|
||||||
|
@ -57,7 +57,7 @@ class utils {
|
|||||||
* @returns {boolean} 如果值是数组,则为True,否则为false
|
* @returns {boolean} 如果值是数组,则为True,否则为false
|
||||||
*/
|
*/
|
||||||
isArray(val) {
|
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) {
|
for (let key in obj) {
|
||||||
let value = obj[key]
|
let value = obj[key]
|
||||||
// eslint-disable-next-line no-constant-condition
|
result[key] = this.deepClone(value)
|
||||||
if (this.getObjClass(value) === 'Object' || 'Array') {
|
|
||||||
result[key] = this.deepClone(value)
|
|
||||||
} else {
|
|
||||||
result[key] = obj[key]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
Loading…
Reference in New Issue
Block a user