12345678910111213141516171819202122 |
- export const hasUpdate = () => {
- const updateManager = uni.getUpdateManager();
- updateManager.onCheckForUpdate(function (res) {
-
- console.log("是否有新版本", res.hasUpdate);
- });
- updateManager.onUpdateReady(function (res) {
- uni.showModal({
- title: "更新提示",
- content: "新版本已经准备好,是否重启应用?",
- success(res) {
- if (res.confirm) {
-
- updateManager.applyUpdate();
- }
- },
- });
- });
- };
|