@zaalbarxx/vue-toasted
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

A Vue 3 port of the vue-toasted library.



Install

  • Install the package from npm
    npm install @zaalbarxx/vue-toasted

Usage

  • Initialize the Vue plugin. For example, for a Vite Vue application
    // main.js
    import Toasted from "@zaalbarxx/vue-toasted"
    import { createApp } from "vue"
    import App from "./App.vue"
    
    // Make sure to include the default stylings
    import "@zaalbarxx/vue-toasted/style.css"
    
    const app = createApp(App)
    
    app.use(Toasted) // You can pass options as a second parameter
  • Now you will be able to access vue-toasted in your Vue components.

    For Options API:
    import { defineComponent } from "vue"
    
    export default defineComponent({
      mounted() {
          // Should give you access to the toasted show function
          this.$toasted.show("Hola! From Options API!")
      }
    })
    For Composition API:
    const toast = useToasted()
    toast.show("Hola! From Composition API!")

Package Sidebar

Install

npm i @zaalbarxx/vue-toasted

Weekly Downloads

4

Version

1.0.0

License

MIT

Unpacked Size

132 kB

Total Files

7

Last publish

Collaborators

  • zaalbarxx