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

[Feature Request] Bind Snackbar to Vue prototype as a function #2776

Closed
hjlld opened this issue Dec 12, 2017 · 3 comments
Closed

[Feature Request] Bind Snackbar to Vue prototype as a function #2776

hjlld opened this issue Dec 12, 2017 · 3 comments
Labels
duplicate The issue has already been reported

Comments

@hjlld
Copy link

hjlld commented Dec 12, 2017

New Functionality

Snackbar, toast, notification and dialog as the messaging components are used frequently in development, which should be bound to vue prototype as a function, like element-ui. For example:

Vue.prototype.$message = function(msgType, position, color, content, ifShowClose, timeout) {
  //msgType = 'v-snackbar' || 'v-dialog' || ...
}

Improvements

So developers can give out a message easily by:

this.$message('v-snackbar', 'top', 'error', 'Bad response from server', true, 3000)

Bugs or Edge Cases it Helps Avoid

none

@KaelWD
Copy link
Member

KaelWD commented Dec 12, 2017

Technically a duplicate of #2384

This won't be on the vue prototype, but we may implement a message queue in the snackbar component itself so you can manage them with something like Vuex.

@KaelWD KaelWD closed this as completed Dec 12, 2017
@KaelWD KaelWD added the duplicate The issue has already been reported label Dec 12, 2017
@hjlld
Copy link
Author

hjlld commented Dec 12, 2017

@KaelWD Thanks a lot for the reply. I don't know exactly how you plan to design this message queue, but not all Vue.js projects use something like Vuex to share and store data. Even if in the message queue, developers should not add <v-snackbar> manually to every route-component / component / page, because almost everyone of them needs to deal messaging. I think binding it to Vue.prototype is an easy way to realize the expectation. Don't make it too complicate to use. PS: I agree that there should be only one snackbar shown in the same time.

@lock
Copy link

lock bot commented Apr 15, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord

@lock lock bot locked as resolved and limited conversation to collaborators Apr 15, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
duplicate The issue has already been reported
Projects
None yet
Development

No branches or pull requests

2 participants