primevue-mirror/doc/toolbar/BasicDoc.vue

150 lines
4.1 KiB
Vue
Raw Normal View History

2023-02-28 08:29:30 +00:00
<template>
<DocSectionText v-bind="$attrs">
<p>Toolbar provides <i>start</i>, <i>center</i> and <i>end</i> properties to place content at these sections.</p>
</DocSectionText>
<div class="card">
<Toolbar>
<template #start>
2024-05-14 07:45:02 +00:00
<Button icon="pi pi-plus" class="mr-2" severity="secondary" text />
<Button icon="pi pi-print" class="mr-2" severity="secondary" text />
<Button icon="pi pi-upload" severity="secondary" text />
2023-02-28 08:29:30 +00:00
</template>
2023-10-23 16:17:47 +00:00
<template #center>
2024-04-08 10:43:16 +00:00
<IconField>
2024-01-30 08:04:48 +00:00
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
2023-10-23 16:17:47 +00:00
<InputText placeholder="Search" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
</template>
2023-10-23 16:17:47 +00:00
2024-01-30 12:03:19 +00:00
<template #end> <SplitButton label="Save" :model="items"></SplitButton></template>
2023-02-28 08:29:30 +00:00
</Toolbar>
</div>
<DocSectionCode :code="code" />
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Update',
icon: 'pi pi-refresh'
},
{
label: 'Delete',
icon: 'pi pi-times'
}
],
code: {
2023-09-22 12:54:14 +00:00
basic: `
<Toolbar>
2023-02-28 08:29:30 +00:00
<template #start>
2024-05-14 07:45:02 +00:00
<Button icon="pi pi-plus" class="mr-2" severity="secondary" text />
<Button icon="pi pi-print" class="mr-2" severity="secondary" text />
<Button icon="pi pi-upload" severity="secondary" text />
2023-02-28 08:29:30 +00:00
</template>
2023-10-23 16:17:47 +00:00
<template #center>
2024-04-08 10:43:16 +00:00
<IconField>
2024-01-30 08:04:48 +00:00
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
2023-10-23 16:17:47 +00:00
<InputText placeholder="Search" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
</template>
2023-10-23 16:17:47 +00:00
2024-01-30 12:03:19 +00:00
<template #end> <SplitButton label="Save" :model="items"></SplitButton></template>
2023-10-15 09:38:39 +00:00
</Toolbar>
`,
2023-09-22 12:54:14 +00:00
options: `
<template>
2023-02-28 08:29:30 +00:00
<div class="card">
<Toolbar>
<template #start>
2024-05-14 07:45:02 +00:00
<Button icon="pi pi-plus" class="mr-2" severity="secondary" text />
<Button icon="pi pi-print" class="mr-2" severity="secondary" text />
<Button icon="pi pi-upload" severity="secondary" text />
2023-02-28 08:29:30 +00:00
</template>
2023-10-23 16:17:47 +00:00
<template #center>
2024-04-08 10:43:16 +00:00
<IconField>
2024-01-30 08:04:48 +00:00
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
2023-10-23 16:17:47 +00:00
<InputText placeholder="Search" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
</template>
2023-10-23 16:17:47 +00:00
2024-01-30 12:03:19 +00:00
<template #end> <SplitButton label="Save" :model="items"></SplitButton></template>
2023-02-28 08:29:30 +00:00
</Toolbar>
</div>
</template>
<script>
export default {
data() {
return {
items: [
{
label: 'Update',
icon: 'pi pi-refresh'
},
{
label: 'Delete',
icon: 'pi pi-times'
}
]
};
}
};
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">
<Toolbar>
<template #start>
2024-05-14 07:45:02 +00:00
<Button icon="pi pi-plus" class="mr-2" severity="secondary" text />
<Button icon="pi pi-print" class="mr-2" severity="secondary" text />
<Button icon="pi pi-upload" severity="secondary" text />
2023-02-28 08:29:30 +00:00
</template>
2023-10-23 16:17:47 +00:00
<template #center>
2024-04-08 10:43:16 +00:00
<IconField>
2024-01-30 08:04:48 +00:00
<InputIcon>
<i class="pi pi-search" />
</InputIcon>
2023-10-23 16:17:47 +00:00
<InputText placeholder="Search" />
2024-01-30 08:04:48 +00:00
</IconField>
2023-02-28 08:29:30 +00:00
</template>
2023-10-23 16:17:47 +00:00
2024-01-30 12:03:19 +00:00
<template #end> <SplitButton label="Save" :model="items"></SplitButton></template>
2023-02-28 08:29:30 +00:00
</Toolbar>
</div>
</template>
<script setup>
import { ref } from 'vue';
const items = ref([
{
label: 'Update',
icon: 'pi pi-refresh'
},
{
label: 'Delete',
icon: 'pi pi-times'
}
])
2023-10-15 09:38:39 +00:00
<\/script>
`
2023-02-28 08:29:30 +00:00
}
};
}
};
</script>