New model for split button demos

pull/6483/head
Cagatay Civici 2024-09-26 11:19:50 +03:00
parent 7a32f796b8
commit 47a0bfc4c3
13 changed files with 211 additions and 147 deletions

View File

@ -26,12 +26,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -63,11 +65,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
}
{ label: 'Upload', to: '/fileupload' }
]
};
@ -96,22 +101,24 @@ const items = [
{
label: 'Update',
command: () => {
toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
command: () => {
toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -26,12 +26,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -63,12 +65,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
]
};
},
@ -105,12 +109,14 @@ const items = [
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -28,13 +28,15 @@ export default {
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
separator: true
},
{
label: 'Quit',
icon: 'pi pi-power-off',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -68,13 +70,15 @@ export default {
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
separator: true
},
{
label: 'Quit',
icon: 'pi pi-power-off',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/fileupload' }
}
]
};
},
@ -103,24 +107,26 @@ const items = [
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
icon: 'pi pi-times',
command: () => {
toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
separator: true
},
{
label: 'Quit',
icon: 'pi pi-power-off',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -166,6 +166,11 @@ export default {
}
]
};
},
methods: {
save() {
this.$toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
}
}
};
<\/script>
@ -247,10 +252,19 @@ const items = [
]
}
];
const save = () => {
toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
};
<\/script>
`
}
};
},
methods: {
save() {
this.$toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });
}
}
};
</script>

View File

@ -33,12 +33,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -84,12 +86,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
]
}
},
@ -124,22 +128,24 @@ const items = [
{
label: 'Update',
command: () => {
toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
command: () => {
toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -33,12 +33,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -84,12 +86,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
]
};
},
@ -134,12 +138,14 @@ const items = [
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -32,12 +32,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -81,12 +83,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
]
};
},
@ -130,12 +134,14 @@ const items = [
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -33,12 +33,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -84,12 +86,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
]
};
},
@ -134,12 +138,14 @@ const items = [
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -33,12 +33,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -84,12 +86,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
]
};
},
@ -134,12 +138,14 @@ const items = [
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -17,26 +17,25 @@ export default {
items: [
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
icon: 'pi pi-times',
command: () => {
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/upload' }
}
],
code: {
basic: `
@ -61,26 +60,25 @@ export default {
items: [
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
icon: 'pi pi-times',
command: () => {
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/fileupload' }
}
]
};
},
@ -107,28 +105,28 @@ import { useToast } from "primevue/usetoast";
const toast = useToast();
const items = [
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
{
label: 'Update',
command: () => {
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
command: () => {
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
}
},
{
label: 'Delete',
icon: 'pi pi-times',
command: () => {
toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/fileupload' }];
];
const save = () => {
toast.add({ severity: 'success', summary: 'Success', detail: 'Data Saved', life: 3000 });

View File

@ -20,26 +20,25 @@ export default {
items: [
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
icon: 'pi pi-times',
command: () => {
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -70,26 +69,25 @@ export default {
items: [
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
icon: 'pi pi-times',
command: () => {
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/fileupload' }
}
]
};
},
@ -121,26 +119,25 @@ const toast = useToast();
const items = [
{
label: 'Update',
icon: 'pi pi-refresh',
command: () => {
toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
this.$toast.add({ severity: 'success', summary: 'Updated', detail: 'Data Updated', life: 3000 });
}
},
{
label: 'Delete',
icon: 'pi pi-times',
command: () => {
toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
this.$toast.add({ severity: 'warn', summary: 'Delete', detail: 'Data Deleted', life: 3000 });
}
},
{
label: 'Vue Website',
icon: 'pi pi-external-link',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', icon: 'pi pi-upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -32,12 +32,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
],
code: {
basic: `
@ -81,12 +83,14 @@ export default {
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
]
};
},
@ -130,12 +134,14 @@ const items = [
}
},
{
label: 'Vue Website',
separator: true
},
{
label: 'Quit',
command: () => {
window.location.href = 'https://vuejs.org/';
}
},
{ label: 'Upload', to: '/fileupload' }
}
];
const save = () => {

View File

@ -42,16 +42,16 @@ export default {
label: 'Basic',
component: BasicDoc
},
{
id: 'nested',
label: 'Nested',
component: NestedDoc
},
{
id: 'icons',
label: 'Icons',
component: IconsDoc
},
{
id: 'nested',
label: 'Nested',
component: NestedDoc
},
{
id: 'severity',
label: 'Severity',