@/utils#cloneDeep JavaScript Examples
The following examples show how to use
@/utils#cloneDeep.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: index.js From maji with Apache License 2.0 | 6 votes |
/**
* @description: 打开选择组件框
* @param {type}componentName 组件名
* @param {type}fileName 文件名
* @return: 配置数据或组件
*/
export function getComponentFile(componentName, fileName) {
const path = `${manageJson.componentsInfo[componentName].type}/${componentName}`
// 完整数据
if (fileName === 'data') {
return cloneDeep(require(`@/views/lego/funComponents/${path}/data.js`).default)
}
// 取schema
if (fileName === 'schema') {
return require(`@/views/lego/funComponents/${path}/data.js`).default.schema || {}
}
return require(`@/views/lego/funComponents/${path}/${fileName}.vue`).default
}
Example #2
Source File: index.js From maji with Apache License 2.0 | 6 votes |
/**
* @description: 打开选择组件框
* @param {type}componentName 组件名
* @param {type}fileName 文件名
* @return: 配置数据或组件
*/
export function getComponentBaseData(componentName, fileName) {
const path = `${manageJson.componentsInfo[componentName].type}/${componentName}`
// 完整数据
if (fileName === 'data') {
return cloneDeep(require(`@/views/lego/funComponents/${path}/data.js`).default)
}
// 取schema
if (fileName === 'schema') {
return require(`@/views/lego/funComponents/${path}/data.js`).default.schema || {}
}
return require(`@/views/lego/funComponents/${path}/${fileName}.vue`).default
}