https://github.com/dogchef-be/nuxt-prevent-multitabs
🖥️ NuxtJS module to prevent opening the app in multiple tabs
https://github.com/dogchef-be/nuxt-prevent-multitabs
browser-tabs multitabs nuxt nuxt-module nuxtjs-ts nuxtjs-typescript prevent-multitabs
Last synced: about 2 months ago
JSON representation
🖥️ NuxtJS module to prevent opening the app in multiple tabs
- Host: GitHub
- URL: https://github.com/dogchef-be/nuxt-prevent-multitabs
- Owner: dogchef-be
- License: mit
- Created: 2021-11-19T12:17:43.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-26T14:27:04.000Z (over 3 years ago)
- Last Synced: 2024-10-29T16:58:17.134Z (7 months ago)
- Topics: browser-tabs, multitabs, nuxt, nuxt-module, nuxtjs-ts, nuxtjs-typescript, prevent-multitabs
- Language: TypeScript
- Homepage:
- Size: 287 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nuxt-prevent-multitabs
NuxtJS module to prevent opening the app in multiple tabs## Table of contents
- [Setup](#setup)
- [Options](#options)
- [License](#license)## Setup
1. Add `nuxt-prevent-multitabs` dependency to your project:
```bash
npm install nuxt-prevent-multitabs
```2. Create the layout to be used when the client opens another tab. An example:
```html
Cannot open multiple windows
APP_NAME is already open in another window.
Make sure you close it before opening a new one.
Click here to access
import Vue from 'vue'
export default Vue.extend({
methods: {
reload(): void {
location.reload()
},
},
})```
3. Add `nuxt-prevent-multitabs` module and configuration to `nuxt.config.js`:
```js
export default {
// ...other config options
modules: ["nuxt-prevent-multitabs"];
preventMultitabs: {
layout: 'multitab', // optional
}
}
```## Options
### `layout`
- Type: `String`
- Default: `multitab`The layout to be used when the client opens another tab
## License
See the LICENSE file for license rights and limitations (MIT).