Code Monkey home page Code Monkey logo

vue-toaster's People

Contributors

androz2091 avatar james-ingold avatar jprodrigues70 avatar mesqueeb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vue-toaster's Issues

Vue 4 suppport?

$ vue --version
@vue/cli 4.5.12

In main.js

import Toaster from "@meforma/vue-toaster";
Vue.use(Toaster);

WARNING Compiled with 2 warnings 6:32:26 PM

warning in ./node_modules/@meforma/vue-toaster/src/helpers/mount-component.js

"export 'h' was not found in 'vue'

warning in ./node_modules/@meforma/vue-toaster/src/helpers/mount-component.js

"export 'render' was not found in 'vue'

Is this a version issue? I just started using Vue ... I hope the eco system isn't like Python ... :)

Different mounting point

Hi!

We'd like the toast to show relative to a div, instead of fixed to the content window. Is that possible? I didn't see any option in the documentation

Doesn't work in Typescript

I was trying to make this toast run in a typescript vue3 app but it wouldn't read the import string. Anyone else have that issue?

Use vue-toaster inside action.js

For a project i'm using vuex actions.
Inside the .js file i get the error: TypeError: Cannot read property '$toast' of undefined

How do i solve this issue?

Import not work in main.js

In my Vue project toaster import give error in main.js

the error is:
http://127.0.0.1:5173/node_modules/.vite/deps/@meforma_vue-toaster.js?v=5508a788 net::ERR_ABORTED 504 (Outdated Optimize Dep)

My main.js file is

import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'
import './assets/main.css'
import axios from 'axios'
import Toaster from '@meforma/vue-toaster';
const app = createApp(App)
app.use(createPinia())
app.use(router, axios,Toaster)
app.mount('#app')

Composition API support?

Hello,
Is it possible to use the component in Composition API?
As far as I see, the example is based on Options API.

Thanks!

Calling this.$toast.clear() doesn't clear any toasts (using Vite)

main.js

import Toaster from '@meforma/vue-toaster'

app.use(Toaster, {
  position: 'top',
  useDefaultCss: false,
  pauseOnHover: false
}).provide('toast', app.config.globalProperties.$toast)

Example.vue

<script setup>
import { inject } from 'vue'

const toast = inject('toast')

// this works
function showToast (type) {
  toast.show(`This is the ${type} type toast.`, {
    type: type,
    duration: false
  })
}

// only works when vue-toaster is local in my projects src folder :S
function clearToasts () {
  toast.clear()
}
</script>

package.json

...
"@meforma/vue-toaster": "^1.3.0",
"vue": "^3.2.31",

Ty, otherwise all works perfectly.

Custom CSS

I'm using tailwindcss. How can I override the standard settings and use my own?

ReferenceError glob is not defined

When trying to use on a fresh sandbox Vue 3 template
I get the following error:

ReferenceError

/node_modules/@meforma/vue-toaster/src/Toaster.vue:299:9
   295| index(list, value)
   296|   for val, i in list
   297|     return i if val == value
   298| 
   299| @import './themes/default/index.styl'
----------------^
   300| .v--default-css
   301|   @import './themes/default/colors.styl'
   302|   @import './themes/default/toast.styl'

glob is not defined

ReferenceError: /node_modules/
meforma/vue-toaster/src/Toaster.vue:299:9

See: https://codesandbox.io/s/vue-toaster-1gmkk?file=/src/App.vue

Define maxToast prop

Expected: when the maximum number of toasts is reached, the next toasts are queued. When the number of toasts is less than the maximum, the queue will be processed.

Why the toaster doesn't show up on mobile browsers?

I don't event need to put here my code, cause all work fine on desctop and even on desctop with fewer browser's width. But when i trigger the toaster on mobile browser, it just didn't open.
I looked into your code and checked if could see "toast-container.styl" by adding border 1px solid line. So on desctop i saw it and on mobile haven't saw it again.

Warnings when installing?

I get these warnings when I install the toaster, should these be fixed or?

[1/4] ๐Ÿ” Resolving packages...

warning @meforma/vue-toaster > stylus > css-parse > css > [email protected]: Please see https://github.com/lydell/urix#deprecated

warning @meforma/vue-toaster > stylus > css-parse > css > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated

warning @meforma/vue-toaster > stylus > css-parse > css > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated

[2/4] ๐Ÿšš Fetching packages...
[3/4] ๐Ÿ”— Linking dependencies...

warning "@vue/cli-service > @babel/[email protected]" has unmet peer dependency "@babel/core@^7.0.0".

warning "@vue/cli-service > [email protected]" has incorrect peer dependency "webpack@^4.0.0".

Cannot read properties of undefined (reading '$toast')

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '$toast')
at _callee$ (app.js:21711:23)
at tryCatch (app.js:39729:40)
at Generator.invoke [as _invoke] (app.js:39960:22)
at Generator.next (app.js:39785:21)
at asyncGeneratorStep (app.js:21677:103)
at _next (app.js:21679:194)

Uncaught ReferenceError: require is not defined

Uncaught ReferenceError: require is not defined
    at Proxy.mounted (vue-toaster.js:161)
    at callWithErrorHandling (runtime-dom.esm-bundler-d92ceebf.js:1292)
    at callWithAsyncErrorHandling (runtime-dom.esm-bundler-d92ceebf.js:1301)
    at Array.hook.__weh.hook.__weh (runtime-dom.esm-bundler-d92ceebf.js:3011)
    at flushPostFlushCbs (runtime-dom.esm-bundler-d92ceebf.js:1471)
    at Object.render (runtime-dom.esm-bundler-d92ceebf.js:5774)
    at render (runtime-dom.esm-bundler-d92ceebf.js:9175)
    at mount (vue-toaster.js:290)
    at Object.show (vue-toaster.js:307)
    at Object.success (vue-toaster.js:317)

Use in Composition API supported?

Hi, I tried to use your plugin with Vue 3 and TypeScript but could not make it work.
I added a .d.ts file to make TypeScript ignore missing types and just be happy.
In my mina.ts I added

import Toaster from '@meforma/vue-toaster';
// ...
app.use(Toaster);

In my App.ts I am using the Composition API with setup() like this:

export default defineComponent({
    setup(props, context): any {
       // ...
       // this.$toast('Hi there');
       // ...
    }
}

Unfortunately, this.$toast is not available because of the Composition API.
I checked the docs and searched a lot on the internet but to no avail.

Any idea how to make it work?

Simple Import in app.js not working Vue3 /Inertia

import Toaster from "@meforma/vue-toaster";
createInertiaApp({
title: (title) => ${title} - ${appName},
resolve: (name) => resolvePageComponent(./Pages/${name}.vue, import.meta.glob('./Pages/**/*.vue')),
setup({ el, App, props, plugin }) {
return createApp({ render: () => h(App, props) })
.use(plugin)
.use(Toaster)
.use(ZiggyVue)
.mount(el);
},

Vue File :
Tried
toast.show(Hey! I'm here);
this.$toast.show(Hey! I'm here);
Error : toast is not defined

Import inside vue file works fine , import from app.js not working // Laravel , Vue3 , InertiaJs , ViteJs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.