https://github.com/yanyue404/nuxt-web-update-notification
nuxt-web-update-notification
https://github.com/yanyue404/nuxt-web-update-notification
Last synced: 3 months ago
JSON representation
nuxt-web-update-notification
- Host: GitHub
- URL: https://github.com/yanyue404/nuxt-web-update-notification
- Owner: yanyue404
- License: mit
- Created: 2023-09-04T11:25:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-06T03:23:59.000Z (over 1 year ago)
- Last Synced: 2025-02-02T14:02:45.715Z (3 months ago)
- Language: JavaScript
- Size: 67.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nuxt-web-update-notification [](https://npmjs.com/package/nuxt-web-update-notification)
Detect webpage updates and notify user to reload. support Nuxt.
## Install
```bash
# use yarn (recommend)
yarn add -D nuxt-web-update-notification
# or use npm
npm install --save-dev nuxt-web-update-notification
```## Example
```js
// nuxt.config.js
export default {
mode: 'universal',
env: {
PATH_TYPE: process.env.PATH_TYPE,
},
/*
** Nuxt.js modules
*/
modules: [
[
'nuxt-web-update-notification',
{
logVersion: true,
checkInterval: 5 * 60 * 1000, // 5 分钟设置轮询一次
// 在某些环境下才开启该 Module
shouldBeEnable: (options) => {
if (options.env.PATH_TYPE === 'trial') {
return true;
}
return false;
},
},
],
],
};
```## Thanks
- [plugin-web-update-notification](https://github.com/GreatAuk/plugin-web-update-notification)
- [网页重新部署,通知用户-最佳实践](https://juejin.cn/post/7209234917288886331)