<script>
const obj = {
skills: [
{
type: [],
a: null,
},
{
a: '',
b: 0,
type: undefined,
},
],
};
function $removeEmptyField(data, excludes = ['', null, undefined]) {
let newObj = {};
if (typeof data === 'string') {
data = JSON.parse(data);
}
if (data instanceof Array) {
newObj = [];
}
if (data instanceof Object) {
for (const attr in data) {
if (!excludes.includes(data[attr])) {
if (data[attr] instanceof Object) {
if (JSON.stringify(data[attr]) === '{}' || JSON.stringify(data[attr]) === '[]') {
continue;
}
newObj[attr] = $removeEmptyField(data[attr]);
} else if (
typeof data[attr] === 'string'
&& ((data[attr].indexOf('{') > -1 && data[attr].indexOf('}') > -1)
|| (data[attr].indexOf('[') > -1 && data[attr].indexOf(']') > -1))
) {
try {
const attrObj = JSON.parse(data[attr]);
if (attrObj instanceof Object) {
newObj[attr] = $removeEmptyField(attrObj);
}
} catch (e) {
newObj[attr] = data[attr];
}
} else {
newObj[attr] = data[attr];
}
}
}
}
return newObj;
}
console.log($removeEmptyField(obj));
</script>
没有合适的资源?快使用搜索试试~ 我知道了~
基于 Vue3 + Vite3 + Pinia2 的王者荣耀后台管理系统源码.zip
共331个文件
vue:125个
png:54个
js:54个
需积分: 1 0 下载量 109 浏览量
2022-10-13
13:03:47
上传
评论 1
收藏 32.89MB ZIP 举报
温馨提示
基于 Vue3 + Vite3 + Pinia2 的王者荣耀后台管理系统源码.zip
资源详情
资源评论
资源推荐
收起资源包目录
基于 Vue3 + Vite3 + Pinia2 的王者荣耀后台管理系统源码.zip (331个子文件)
.eslintrc.cjs 2KB
index.css 2KB
index.css 2KB
index.css 2KB
clear.css 2KB
index.css 1KB
common.css 1KB
index.css 1KB
animate.css 1KB
beautify.css 1KB
index.css 1KB
index.css 988B
view.css 957B
css-variable.css 885B
index.css 669B
index.css 635B
index.css 546B
index.css 510B
index.css 216B
.env.development 64B
.gitignore 253B
index.html 1KB
index.js 85KB
sidebar.js 53KB
directives.js 10KB
icon.js 9KB
routes.js 3KB
index.js 3KB
icon.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
auth.js 2KB
index.js 2KB
index.js 2KB
index.js 2KB
useIntegrationData.js 2KB
index.js 2KB
index.js 2KB
useSound.js 1KB
equip.js 1KB
useViewHide.js 1KB
index.js 1KB
index.js 912B
index.js 912B
index.js 904B
vite.config.js 904B
index.js 896B
index.js 896B
index.js 896B
index.js 888B
index.js 888B
index.js 888B
index.js 880B
index.js 880B
index.js 874B
index.js 872B
index.js 872B
index.js 864B
index.js 864B
useTip.js 855B
index.js 852B
index.js 843B
index.js 840B
transfer.js 838B
index.js 816B
hero.js 659B
epigraph.js 610B
useLoading.js 608B
useManageCard.js 585B
main.js 581B
index.js 348B
globalSwitch.js 204B
eventBus.js 74B
mixins.js 0B
package-lock.json 444KB
wzry.json 53KB
package.json 1KB
index.less 2KB
index.less 2KB
index.less 2KB
index.less 2KB
index.less 1KB
index.less 1KB
index.less 1KB
index.less 1KB
index.less 1KB
view.less 891B
index.less 862B
index.less 684B
index.less 660B
index.less 547B
index.less 544B
index.less 389B
index.less 210B
ryzl.mp3 7.46MB
wzbr.mp3 3.86MB
ryzt.mp3 3.33MB
wwkh.mp3 2.87MB
共 331 条
- 1
- 2
- 3
- 4
Java程序员-张凯
- 粉丝: 1w+
- 资源: 6654
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论0