2023-02-28 08:29:30 +00:00
|
|
|
<template>
|
|
|
|
<DocSectionText v-bind="$attrs">
|
2023-10-25 15:22:15 +00:00
|
|
|
<p>A message can be targeted to a certain Toast component by matching the <i>group</i> keys whereas location is customized with the <i>position</i>.</p>
|
2023-02-28 08:29:30 +00:00
|
|
|
</DocSectionText>
|
|
|
|
<div class="card flex justify-content-center">
|
|
|
|
<div class="flex flex-wrap gap-2">
|
2023-10-25 15:22:15 +00:00
|
|
|
<Button label="Top Left" @click="showTopLeft" />
|
2024-04-16 07:35:56 +00:00
|
|
|
<Button label="Bottom Left" severity="warn" @click="showBottomLeft" />
|
2023-10-25 15:22:15 +00:00
|
|
|
<Button label="Bottom Right" severity="help" @click="showBottomRight" />
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<DocSectionCode :code="code" />
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
code: {
|
2023-09-22 12:54:14 +00:00
|
|
|
basic: `
|
|
|
|
<Toast position="top-left" group="tl" />
|
2023-04-06 06:44:34 +00:00
|
|
|
<Toast position="bottom-left" group="bl" />
|
|
|
|
<Toast position="bottom-right" group="br" />
|
|
|
|
|
2023-10-25 15:22:15 +00:00
|
|
|
<Button label="Top Left" @click="showTopLeft" />
|
2024-04-16 07:35:56 +00:00
|
|
|
<Button label="Bottom Left" severity="warn" @click="showBottomLeft" />
|
2023-10-25 15:22:15 +00:00
|
|
|
<Button label="Bottom Right" severity="help" @click="showBottomRight" />
|
2023-10-15 09:38:39 +00:00
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
options: `
|
|
|
|
<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card flex justify-content-center">
|
2023-04-06 06:44:34 +00:00
|
|
|
<Toast position="top-left" group="tl" />
|
|
|
|
<Toast position="bottom-left" group="bl" />
|
|
|
|
<Toast position="bottom-right" group="br" />
|
|
|
|
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="flex flex-wrap gap-2">
|
2023-10-25 15:22:15 +00:00
|
|
|
<Button label="Top Left" @click="showTopLeft" />
|
2024-04-16 07:35:56 +00:00
|
|
|
<Button label="Bottom Left" severity="warn" @click="showBottomLeft" />
|
2023-10-25 15:22:15 +00:00
|
|
|
<Button label="Bottom Right" severity="help" @click="showBottomRight" />
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
methods: {
|
|
|
|
showTopLeft() {
|
|
|
|
this.$toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Content', group: 'tl', life: 3000 });
|
|
|
|
},
|
|
|
|
showBottomLeft() {
|
|
|
|
this.$toast.add({ severity: 'warn', summary: 'Warn Message', detail: 'Message Content', group: 'bl', life: 3000 });
|
|
|
|
},
|
|
|
|
showBottomRight() {
|
|
|
|
this.$toast.add({ severity: 'success', summary: 'Success Message', detail: 'Message Content', group: 'br', life: 3000 });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`,
|
2023-09-22 12:54:14 +00:00
|
|
|
composition: `
|
|
|
|
<template>
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="card flex justify-content-center">
|
2023-04-06 06:44:34 +00:00
|
|
|
<Toast position="top-left" group="tl" />
|
|
|
|
<Toast position="bottom-left" group="bl" />
|
|
|
|
<Toast position="bottom-right" group="br" />
|
2024-04-16 07:35:56 +00:00
|
|
|
|
2023-02-28 08:29:30 +00:00
|
|
|
<div class="flex flex-wrap gap-2">
|
2023-10-25 15:22:15 +00:00
|
|
|
<Button label="Top Left" @click="showTopLeft" />
|
2024-04-16 07:35:56 +00:00
|
|
|
<Button label="Bottom Left" severity="warn" @click="showBottomLeft" />
|
2023-10-25 15:22:15 +00:00
|
|
|
<Button label="Bottom Right" severity="help" @click="showBottomRight" />
|
2023-02-28 08:29:30 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script setup>
|
|
|
|
import { useToast } from "primevue/usetoast";
|
|
|
|
const toast = useToast();
|
|
|
|
|
|
|
|
const showTopLeft = () => {
|
|
|
|
toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Content', group: 'tl', life: 3000 });
|
|
|
|
};
|
|
|
|
|
|
|
|
const showBottomLeft = () => {
|
|
|
|
toast.add({ severity: 'warn', summary: 'Warn Message', detail: 'Message Content', group: 'bl', life: 3000 });
|
|
|
|
};
|
|
|
|
|
|
|
|
const showBottomRight = () => {
|
|
|
|
toast.add({ severity: 'success', summary: 'Success Message', detail: 'Message Content', group: 'br', life: 3000 });
|
|
|
|
};
|
2023-10-15 09:38:39 +00:00
|
|
|
<\/script>
|
|
|
|
`
|
2023-02-28 08:29:30 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
showTopLeft() {
|
|
|
|
this.$toast.add({ severity: 'info', summary: 'Info Message', detail: 'Message Content', group: 'tl', life: 3000 });
|
|
|
|
},
|
|
|
|
showBottomLeft() {
|
|
|
|
this.$toast.add({ severity: 'warn', summary: 'Warn Message', detail: 'Message Content', group: 'bl', life: 3000 });
|
|
|
|
},
|
|
|
|
showBottomRight() {
|
|
|
|
this.$toast.add({ severity: 'success', summary: 'Success Message', detail: 'Message Content', group: 'br', life: 3000 });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
</script>
|