vue-toastr
vue-toastr copied to clipboard
Vue 3 Issue
Hello,
when i use it in vue 3 i get the following error:
Uncaught TypeError: Vue.extend is not a function at Object.VueToastr.install (vue-toastr.esm.js?025a:736) at Object.use (runtime-core.esm-bundler.js?5c40:2945) at eval (main.js?56d7:8) at Module../src/main.js (app.js:1366) at __webpack_require__ (app.js:854) at fn (app.js:151) at Object.1 (app.js:1475) at __webpack_require__ (app.js:854) at checkDeferredModules (app.js:46) at app.js:994
// ... import VueToastr from "vue-toastr"; // ... const app = createApp(App).use(VueToastr).use(store).use(router);
This plugin has not been upgraded for vue.js 3
Is there scope for it to be updated?
@u01jmg3 I am working on it.
I have created a dev branch for vue.js 3 https://github.com/s4l1h/vue-toastr/tree/dev-v3 your contribution is welcome. There are problems about vite bundler and typescript types publishing.
[UP] A release date planned for VueJS 3?
@ValentinRgt @u01jmg3 @Marlight96
I have just published a version of the library for Vue.js 3. ( You can install [email protected] version. )
There is no breaking changes. The api is as same as v2.
I have created a demo https://codesandbox.io/s/quizzical-grass-eb62u
https://github.com/s4l1h/vue-toastr/tree/dev-v3 https://www.npmjs.com/package/vue-toastr/v/3.0.3
Thanks @s4l1h - great work
Previously I was using vue-toastr.common.js - what's the equivalent in your dev-v3 branch?
vue-toastr.cjs.jsvue-toastr.es.jsvue-toastr.iife.jsvue-toastr.umd.js
@u01jmg3 it should be https://github.com/s4l1h/vue-toastr/blob/dev-v3/dist/vue-toastr.cjs.js https://unpkg.com/browse/[email protected]/dist/vue-toastr.cjs.js
Don't forget to import style.css file.
https://github.com/s4l1h/vue-toastr/blob/dev-v3/dist/style.css
Is sourceMappingURL=vue-toastr.cjs.js.map available?
@u01jmg3 We don't publish with source map. https://github.com/s4l1h/vue-toastr/blob/master/.gitignore#L5 Should we publish it?
After looking at other repos it appears it is not common practice to publish the source map. Thanks for following up.