An open API service indexing awesome lists of open source software.

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

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:

image

```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).