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

Custom close function in prompt #315

Closed
iagocavalcante opened this issue Oct 18, 2018 · 5 comments
Closed

Custom close function in prompt #315

iagocavalcante opened this issue Oct 18, 2018 · 5 comments

Comments

@iagocavalcante
Copy link

I'd like to custom close action in prompt

image

I'm building an application with a wrapper of prompt and I'll want to control the close event. I couldn't find props to control that, so I guess this is an interesting new feature in prompt.

@luisDanielRoviraContreras
Copy link
Member

I think you mean this? @close="myFunctionClose"

@iagocavalcante
Copy link
Author

Yes

I think you mean this? @close="myFunctionClose"

Another thing I guess is essential in a dialog is a boolean to enable or disable click outside to close

@brunokunace
Copy link
Contributor

@iagocavalcante when you make a wrapper with .sync atributte, this try to change a prop, (and the props is immutable), but you can make a computed with get and set to change this.

look a example with you code.

https://codesandbox.io/s/n3zq0l6zqj

@iagocavalcante
Copy link
Author

I understand this now, in this case, I can call the method inside the computed to manipulate some states.
But I think this is better to manipulate the event @close or @hide in the vs-prompt to pass the function I desire, what you think?

@luisDanielRoviraContreras
Copy link
Member

it's a very good idea

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

No branches or pull requests

3 participants