-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(VSnackbarQueue): create new component (#19629)
closes #2384 Co-authored-by: John Leider <john@vuetifyjs.com>
- Loading branch information
1 parent
b9a7d69
commit c74d0c9
Showing
55 changed files
with
326 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<template> | ||
<ExamplesUsageExample | ||
v-model="model" | ||
:code="code" | ||
:name="name" | ||
:options="options" | ||
> | ||
<div> | ||
<v-text-field | ||
v-model="text" | ||
label="Queue a message" | ||
hide-details | ||
@keydown.enter="onClick" | ||
> | ||
<template v-slot:append-inner> | ||
<v-btn | ||
:disabled="!text" | ||
append-icon="mdi-arrow-right" | ||
text="Queue" | ||
flat | ||
slim | ||
@click="onClick" | ||
></v-btn> | ||
</template> | ||
</v-text-field> | ||
|
||
<v-snackbar-queue v-model="queue" :color="color" :timeout="timeout"></v-snackbar-queue> | ||
</div> | ||
|
||
<template v-slot:configuration> | ||
<v-select | ||
v-model="color" | ||
:items="['primary', 'secondary', 'success', 'info', 'warning', 'error']" | ||
label="Color" | ||
clearable | ||
></v-select> | ||
|
||
<v-number-input v-model="timeout" min="-1"></v-number-input> | ||
</template> | ||
</ExamplesUsageExample> | ||
</template> | ||
|
||
<script setup> | ||
const name = 'v-snackbar-queue' | ||
const model = ref('default') | ||
const options = [] | ||
const color = shallowRef() | ||
const timeout = shallowRef(5000) | ||
const queue = ref([]) | ||
const text = shallowRef('') | ||
function onClick () { | ||
queue.value.push({ | ||
text: text.value, | ||
timeout: timeout.value, | ||
color: color.value, | ||
}) | ||
} | ||
const props = computed(() => { | ||
return { | ||
color: color.value, | ||
timeout: timeout.value !== 5000 ? timeout.value : undefined, | ||
} | ||
}) | ||
const slots = computed(() => { | ||
return '' | ||
}) | ||
const code = computed(() => { | ||
return `<v-snackbar-queue${propsToString(props.value)}>${slots.value}</v-snackbar-queue>` | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,8 +12,6 @@ | |
|
||
<AppBackToTop /> | ||
|
||
<AppSnackbarQueue /> | ||
|
||
<v-main> | ||
<slot> | ||
<v-container | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
emphasized: true | ||
meta: | ||
nav: Snackbar Queue | ||
title: Snackbar Queue component | ||
description: test | ||
keywords: test | ||
related: | ||
- /components/buttons/ | ||
- /components/snackbars/ | ||
- /components/defaults-providers/ | ||
features: | ||
github: /labs/VSnackbarQueue/ | ||
label: 'C: VSnackbarQueue' | ||
report: true | ||
spec: https://m2.material.io/components/snackbars | ||
--- | ||
|
||
# Snackbar Queue | ||
|
||
The `v-snackbar-queue` component is used to queue up multiple snackbar messages to be displayed to the user. Snackbars support positioning, removal delay, and callbacks. | ||
|
||
<PageFeatures /> | ||
|
||
## Usage | ||
|
||
<ExamplesUsage name="v-snackbar-queue" /> | ||
|
||
<PromotedEntry /> | ||
|
||
## API | ||
|
||
| Component | Description | | ||
| - | - | | ||
| [v-snackbar-queue](/api/v-snackbar-queue/) | Primary Component | | ||
| [v-snackbar](/api/v-snackbar/) | The actual Snackbar Component | | ||
|
||
<ApiInline hide-links /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.