-
Notifications
You must be signed in to change notification settings - Fork 544
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
feat(Slideover): open programmatically #1465
Conversation
15831c1
to
86238b1
Compare
β¦ SlideoverExampleComposable.vue files
@noook Since you originally created the |
LGTM. @genu Just so you know, this implementation has the drawback that the passed props are not reactive within the slideover. |
hmm, what needs to be changed, I thought its modeled pretty closely to If significant refactoring, perhaps defer that aspect to a later enhancement? π€ |
@genu I don't know yet, useModal is built the same way and has the same drawback, this is something I noticed too while building it. After thoughts, I realized that when opening the modal or the slideover, you don't really expect or have the need to have reactive props after all |
I agree, however, I'd note that I was able to use reactivity in const confirmPending = ref(false);
modal.open(DialogConfirm, {
title: 'Do something async?',
description: "Are you sure you want to the async thing?",
confirmPending,
onConfirm: async () => {
confirmPending.value = true;
await doAsyncThing()
confirmPending.value = false;
modal.close();
},
onDismiss: modal.close,
}); and in my Modal: defineProps<{
title: string;
icon?: string;
color?: string;
description: string;
confirmLabel?: string;
dismissLabel?: string;
confirmPending?: Ref<boolean>;
}>(), |
Yes indeed, that works. I don't know to what extent passing a ref as is as a prop is correct |
π Linked issue
Resolves #1455
β Type of change
π Description
useSlideover
composable to control the displaying of a slideover from a componentπ Checklist