当前位置:网站首页>参数序列化
参数序列化
2022-06-22 05:24:00 【Best_卡卡】
// 参数序列化
Vue.prototype.seParams = (obj) => {
// 该方法会把值为0 的项过滤掉
// 如果所有项都会空 则不会返回 ‘?’
var str = ''
for (var key in obj) {
var item = obj[key]
if (item !== null && item !== undefined && item !== '') {
str += `${key}=${item}&`
}
}
if (str.length !== 0) {
str = '?' + str.substr(0, str.length - 1)
}
return str
}
边栏推荐
- Traveler's budget (Los Angeles Valley)
- [chrome] Google tips Google browser comes with scrolling screenshot (full screen shot)
- 《双内核实时系统下各个进程间通信方法的性能分析和测试》
- Link a static library‘s all sections
- QEMU ARM interrupt system architecture
- It's 2022. Don't you hurry to learn typescript?
- C语言自定义函数的一些注意事项
- Leetcode hot1-50
- Record local project startup error: invalid source distribution: 8
- Literacy of C language concept knowledge (supplemented and updated from time to time)
猜你喜欢

Accelerate the promotion of industrial Internet, and map out a new blueprint for development

毕业季 | 新的开始,不说再见

Remove then add string from variable of Makefile

2022 welder (primary) new version test questions and welder (primary) free test questions

2022 Shanxi secondary vocational group "Cyberspace Security" event module b- web page penetration

Kubernetes -- setting up an environment using minicube

A piece of code to solve the problem of automatic disconnection of Google colab

JS regular expression to implement the thousands separator

部署SuperMap iServer war包时的服务迁移

Kubernetes - bare metal cluster environment
随机推荐
When idea creates a method, it uses annotations to prompt method parameters (param), return value (return), and method function (description)
C语言数据类型转换规则(隐式转换+显式转换)
中小企业签署ERP合同时,需要留意这几点
Remove then add string from variable of Makefile
SQL分类,用户属性
P1160 queue arrangement
2022 refrigeration and air conditioning equipment operation test paper and refrigeration and air conditioning equipment operation test skills
Link a static library‘s all sections
2022 new test questions for tea specialists (primary) and summary of tea specialists (primary) examination
liunx虚拟机环境使用docker安装oracle数据库,并使用navicat连接
[chrome] Google tips Google browser comes with scrolling screenshot (full screen shot)
Kubernetes——裸机搭建集群环境
Detailed explanation of OpenCV function usage 11~20, including code examples
long start = currentTimeMillis();
Six sides tmall has already offered. After a review of my experience, is it really that difficult to enter a big factory?
LeetCode热题 HOT1-50
Rambbmitmq consumer
TIDB-升级版本
P1061 [NOIP2006 普及组] Jam 的计数法
Gerrit Code Review Setup