vue-toasted
vue-toasted copied to clipboard
TypeScript returns a type error about ToastOptions.icon
Type Script returns a type error in following codes:
const toast = Vue.toasted.error(msg, {
...
icon: 'mdi mdi-alert'
...
});
Error message: Types of property 'icon' are incompatible.
It seems that definitions need to be changed as below:
(-) icon?: (ToastIcon: HTMLElement) => HTMLElement | string | { name: string, after: boolean },
(+) icon?: ((ToastIcon: HTMLElement) => HTMLElement) | string | { name: string, after: boolean },
Please check changes of the commit a03cc406b1a75acbcb14c3ee0ed9d3da25c68a0a
Thanks
Thanks @shakee93 for your time. Code is already OK in the repo, but not in the current release (1.1.27). When do you plan to push a new release ?
Any news regarding this issue?
I happen to experience the same issue. Usage:
Vue.toasted.success(response, { icon: 'times-circle' })
TypeScript error:
Argument of type '{ icon: string; }' is not assignable to parameter of type 'ToastOptions'.
Types of property 'icon' are incompatible.
Type 'string' is not assignable to type '((ToastIcon: HTMLElement) => string | HTMLElement | { name: string; after: boolean; }) | undefined'.
Using the fix mentioned above you can get rid of this issue.
@shakee93 Can you release changes ?
Will someone please merge the PR? Is the author still active?
We've gone ahead and just installed the git repo directly for the meantime. (The compiled code is included in the GitHub repo.)
npm i git+https://github.com/shakee93/vue-toasted.git