Skip to content

Installation

TIP

View it with a PC, the effect is even better

Requirements

vue version >=3.2.0

Installation

bash
npm install --save vue3-toastify
npm install --save vue3-toastify
bash
yarn add vue3-toastify
yarn add vue3-toastify

Global config

see: demo --> main.js

demo

WARNING

Don't forget to import styles

For Jsx
jsx
import { toast } from 'vue3-toastify';
import { defineComponent } from 'vue';
import 'vue3-toastify/dist/index.css';

const JsxDemo = defineComponent({
  setup() {
    const notify = () => {
      toast('Wow so easy !');
    };

    return () => (
      <div>
        <button onClick={notify}>Notify !</button>
      </div>
    );
  },
});

export default JsxDemo;
import { toast } from 'vue3-toastify';
import { defineComponent } from 'vue';
import 'vue3-toastify/dist/index.css';

const JsxDemo = defineComponent({
  setup() {
    const notify = () => {
      toast('Wow so easy !');
    };

    return () => (
      <div>
        <button onClick={notify}>Notify !</button>
      </div>
    );
  },
});

export default JsxDemo;
<template>
  <h1>Hello {{ msg }}</h1>
</template>

<script setup lang="ts">
import { ref } from 'vue';
const msg = ref<string>('world');
</script>

Released under the MIT License.