Skip to content

Pause toast timer when the window loses focus

The default behavior is to pause the toast timer whenever the window loses focus. You can opt-out by setting the pauseOnFocusLoss props to false.

<template>
  <h1>Hello {{ msg }}</h1>
</template>

<script setup lang="ts">
import { ref } from 'vue';
const msg = ref<string>('world');
</script>
  • disable globally
ts
app.use(
  Vue3Toasity,
  {
    pauseOnFocusLoss: false,
  } as ToastContainerOptions,
);
app.use(
  Vue3Toasity,
  {
    pauseOnFocusLoss: false,
  } as ToastContainerOptions,
);

or

ts
updateGlobalOptions({ rtl: true });

toast.success('Wow so easy!');
updateGlobalOptions({ rtl: true });

toast.success('Wow so easy!');

Released under the MIT License.