@marsjs/api
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -86,3 +86,3 @@ /** | ||
} | ||
delta = parseInt(delta, 10); | ||
delta = parseInt(delta || 1, 10); | ||
let routes = this.$router.options.routes; | ||
@@ -101,3 +101,31 @@ delta > routes.length | ||
/** | ||
* 跳转到 tabBar 页面 | ||
* @param {Object} options 跳转参数 | ||
* @param {string} options.url 需要跳转的 tabBar 页面的路径 | ||
* @param {Function} options.success 接口调用成功的回调函数 | ||
* @param {Function} options.fail 接口调用失败的回调函数 | ||
* @param {Function} options.complete 接口调用结束的回调函数(调用成功、失败都会执行) | ||
*/ | ||
function switchTab(options) { | ||
let { | ||
url, | ||
success, | ||
fail, | ||
complete | ||
} = options; | ||
this.$router && this.$router.push({ | ||
path: url | ||
}, function (res) { | ||
callback(success, res); | ||
callback(complete, res); | ||
}, function (res) { | ||
callback(fail, res); | ||
callback(complete, res); | ||
}); | ||
} | ||
/** | ||
* 需要跳转的应用内页面路径 , 路径后可以带参数。参数与路径之间使用 ? 分隔,参数键与参数值用=相连,不同参数用 & 分隔;如 ‘path?key=value&key2=value2’,如果跳转的页面路径是 tabBar 页面则不能带参数。不支持回调。 | ||
@@ -118,3 +146,4 @@ * @param {Object} options 跳转参数 | ||
navigateBack, | ||
reLaunch | ||
reLaunch, | ||
switchTab | ||
}; |
@@ -6,2 +6,15 @@ # Change Log | ||
## [1.0.18](https://github.com/max-team/Mars/compare/@marsjs/api@1.0.17...@marsjs/api@1.0.18) (2019-06-04) | ||
### Features | ||
* **api:** add navigate api: switch tab ([ff33fda](https://github.com/max-team/Mars/commit/ff33fda)) | ||
# @marsjs/api | ||
## [1.0.17](https://github.com/max-team/Mars/compare/@marsjs/api@1.0.16...@marsjs/api@1.0.17) (2019-04-16) | ||
@@ -12,11 +25,9 @@ | ||
* **systeminfo:** fix UC bug becauseOf its unusual userAgent ([fa347d0](https://github.com/max-team/Mars/commit/fa347d0)) | ||
* **api:** fix UC systeminfo bug becauseOf its unusual userAgent ([fa347d0](https://github.com/max-team/Mars/commit/fa347d0)) | ||
## [1.0.16](https://github.com/max-team/Mars/compare/@marsjs/api@1.0.16...@marsjs/api@1.0.16) (2019-04-12) | ||
## [1.0.16](https://github.com/max-team/Mars/compare/@marsjs/api@1.0.16...@marsjs/api@1.0.16) (2019-04-16) | ||
### Features | ||
@@ -23,0 +34,0 @@ |
{ | ||
"name": "@marsjs/api", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"browser": "index.js", | ||
@@ -12,3 +12,3 @@ "scripts": { | ||
}, | ||
"gitHead": "c06b1b6defdff89c31582297ca3be1f62bfc62a2" | ||
"gitHead": "e7b9db6988b630f289186df83226d75ed57394dd" | ||
} |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
92167
2772
2