url 参数转换
#url解析
#parseUrlParams
<template>
<div class="wrapper">
<text>parseUrlParams:url解析 </text>
</div>
</template>
<script>
export default {
data:()=> ({
name: 'parseUrlParams',
}),
methods: {
cloneHandler() {
let url = 'http://dolphin-weex-dev.msmartlife.cn?name=dolpinweex&num=1&index=10'
//数据深拷贝
let res = this.$util.parseUrlParams(url)
this.$toast(res)
}
}
}
</script>
<style scoped>
.wrapper{
background-color: #ffffff;
}
</style>
| Params |
Type |
Required |
default |
Value |
url |
String |
N |
weex.config.bundleUrl |
url地址 |
#url参数序列化
#serializeUrlParams
<template>
<div class="wrapper">
<text>serializeUrlParams: url参数序列化 </text>
</div>
</template>
<script>
export default {
data:()=> ({
name: 'serializeUrlParams',
}),
methods: {
cloneHandler() {
let urlParams = {
type: 1,
pageSize: 20,
pageIndex: 10,
options: [1,2,3]
}
//数据深拷贝
let res = this.$util.serializeUrlParams(urlParams)
this.$toast(res)
}
}
}
</script>
<style scoped>
.wrapper{
background-color: #ffffff;
}
</style>
| Params |
Type |
Required |
default |
Value |
data |
Object |
N |
{} |
参数 |
isPrefix |
Boolean |
N |
true |
是否自动加上 ? |