feat: add document for AdvanceTable.vue; 🐛

新增:给 AdvanceTable.vue 增加说明文档;
This commit is contained in:
chenghongxing
2020-10-05 16:48:50 +08:00
parent a4281b62dc
commit 3619242076
17 changed files with 488 additions and 150 deletions

View File

@@ -134,6 +134,28 @@ function loadInterceptors(interceptors, options) {
})
}
/**
* 解析 url 中的参数
* @param url
* @returns {Object}
*/
function parseUrlParams(url) {
const params = {}
if (!url || url === '' || typeof url !== 'string') {
return params
}
const paramsStr = url.split('?')[1]
if (!paramsStr) {
return params
}
const paramsArr = paramsStr.replace(/&|=/g, ' ').split(' ')
for (let i = 0; i < paramsArr.length / 2; i++) {
const value = paramsArr[i * 2 + 1]
params[paramsArr[i * 2]] = value === 'true' ? true : (value === 'false' ? false : value)
}
return params
}
export {
METHOD,
AUTH_TYPE,
@@ -141,5 +163,6 @@ export {
setAuthorization,
removeAuthorization,
checkAuthorization,
loadInterceptors
loadInterceptors,
parseUrlParams
}