Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Brilliant project, Feature request? #1

Closed
2 of 4 tasks
cwadrupldijjit opened this issue Jan 30, 2019 · 4 comments
Closed
2 of 4 tasks

Brilliant project, Feature request? #1

cwadrupldijjit opened this issue Jan 30, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@cwadrupldijjit
Copy link

cwadrupldijjit commented Jan 30, 2019

So I think that this project is great! It's simple and straightforward, too. However, there are a few things that I feel could be good features on top of what's already implemented.

  • Add support for dismissing a toast programmatically, especially with a bulk dismiss function
  • Add support for custom toast templates, so that a header and body could be used (Slots?)
  • Add support for other actions to exist on the toast
  • Add TypeScript support

Are any of these on the radar? The TypeScript support shouldn't be hard to create, and I've created what should work for dismissing all of the components (though it's using a property on an element that likely isn't supposed to be used for non-Vue-core code to access a component instance). Would you appreciate PRs for some of these suggestions?

@ankurk91 ankurk91 self-assigned this Jan 31, 2019
@ankurk91
Copy link
Owner

  1. Add support for dismissing a toast programmatically, especially with a bulk dismiss function
    It is possible to close a toast programmatically already.
let toast = Vue.$toast.open('You did it!');
// dismiss
toast.close();
  1. Add support for custom toast templates, so that a header and body could be used (Slots?)

Yes, We can use slots for template customisation.

  1. Add support for other actions to exist on the toast

What are the other actions?

  1. Add TypeScript support

I am not interested in learning any foreign language. (Not being rude)
Please don't send any PR related to TypeScript.

  1. Dismiss all of toast at once

We can use vue event bus for it.

I am open to receive PR for slots and event bus.
Thanks.

@ankurk91 ankurk91 added the enhancement New feature or request label Jan 31, 2019
@cwadrupldijjit
Copy link
Author

cwadrupldijjit commented Feb 7, 2019

I wouldn't replace JS with TypeScript, if that's what you were wondering. I was just talking about adding type definition files so that people using TypeScript can use it easier. If you'd prefer not, then I won't submit it to you. Instead, I may end up adding type definitions to the DefinitelyTyped project. I do this because my company does use TypeScript.

Slots would mean a slight change in implementation, and upon reflection, it may not be the best fit. We could potentially do a template system, but that starts to get complicated and would possibly require shipping with the compiler, which would make most apps bloated. More discussion would be necessary before we could do that.

@ankurk91
Copy link
Owner

ankurk91 commented Feb 8, 2019

I would prefer DefinitelyTyped project as separate package that you owns.

Regarding slots:
One of my other package allows users to specify the slot in this way.

https://github.com/ankurk91/vue-loading-overlay/blob/c0fb278d9e66a4616edcc46a57a03a7a92be2e62/src/js/Component.vue#L13-L17

I am thinking of these slots:

  • title (optional)
  • message (default)
  • action (optional clickable button with callback)

@ankurk91 ankurk91 removed their assignment Mar 7, 2019
@ankurk91
Copy link
Owner

Follow #17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants