front-version-update-check

1.0.0 • Public • Published

Example of usage:

import { initSystemVersionCheck, cancelVersionCheck } form 'front-version-update-check';

initSystemVersionCheck(
  {
    filePath: "/index.html", // 需要拉取检测的服务器文件
    intervalTime: 15000 // 拉取的间隔,默认30s
  },
  () => {
    MessageBox.confirm("检测到系统有新版本,是否刷新页面?", "提示", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    })
      .then(() => {
        location.reload();
      })
      .catch(() => {
        cancelVersionCheck(); // 取消拉去检测
      });
  }
);

Readme

Keywords

Package Sidebar

Install

npm i front-version-update-check

Weekly Downloads

0

Version

1.0.0

License

ISC

Unpacked Size

2.68 kB

Total Files

3

Last publish

Collaborators

  • davinciyu