@j2only/ionic-disable-swipe-back
Version:
Vue 3 directive for Ionic framework, disables switching to previous route if the user makes a swipe on iOS devices
43 lines (29 loc) • 1.64 kB
Markdown
# @j2only/ionic-disable-swipe-back
 [](https://www.npmjs.com/package/@j2only/ionic-disable-swipe-back)   [](https://www.typescriptlang.org/) [](https://github.com/j2only/ionic-disable-swipe-back/issues) 
## Installation
Install this component via package manager:
```bash
yarn add @j2only/ionic-disable-swipe-back
```
## Usage
Import the component in your app. Example of the main.ts file in your ionic vue project:
```typescript
<script setup lang="ts">
import App from "./App.vue"
import { DisableSwipeBackDirective } from "@j2only/ionic-disable-swipe-back"
const app = createApp(App)
.directive("disable-swipe-back", DisableSwipeBackDirective)
app.mount("#app")
</script>
```
In vue template include directive in ion-page
```vue
<template>
<ion-page v-disable-swipe-back>
...
</ion-page>
</template>
```
## Licensing
MIT License
Forked from [@Sitronik/v-disable-swipe-back](https://github.com/Sitronik/v-disable-swipe-back), Sitronik, [MIT License](LICENSE)