[vue-3] Make useToast available from import
See original GitHub issueI’m submitting a …
[ ] Bug report => search github for a similar issue or PR before submitting
[x] Feature request
[ ] Other, please describe
Tell about your platform
- Vue.js version : 3.0.x
- This package version : next
Current behavior
The $toast
object is only available in components, not from imports.
Expected behavior I would be nice to have useToast available for in .ts files - for instance in Vuex.
example.ts
import { useToast } from "vue-toast-notification";
useToast.success("Hello world.");
It should be as simple matter of exporting { useToast }
in index.js
and changing the .d.ts
file.
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (8 by maintainers)
Top Results From Across the Web
How to create reusable toastService with primeVue toast?
Second: import app and use toast service with app.config. ... still work (until build time where another solution should be found) const key ......
Read more >How to use toast notification with Vue 3 and Laravel | Part 10
If you are interested to work with me then please email me at: channel.clovon@gmail.comYou can support the growth of this channel by ...
Read more >vue-toast-notification - npm
import Vue from 'vue'; import VueToast from 'vue-toast-notification'; // Import one of the available themes //import ...
Read more >Vue.js toast notification plugin for vue 3
Vue Toaster · Installation · Import · Usage · Available options · API methods · Global options · How to execute example.
Read more >Vue Toast Component - PrimeFaces
$toast is available as a property in the application instance. ... import { defineComponent } from "vue"; import { useToast } from "primevue/usetoast"; ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
fixed with 2.0.1
Looks like webpack is removing un used exports from bundle
https://unpkg.com/browse/vue-toast-notification@2.0.0/dist/index.js
Need to find a way to prevent this