130 lines
4.1 KiB
Vue
130 lines
4.1 KiB
Vue
<template>
|
|
<div class="content-section documentation">
|
|
<TabView>
|
|
<TabPanel header="Documentation">
|
|
<h3>Import</h3>
|
|
<CodeHighlight lang="javascript">
|
|
import Toolbar from 'primevue/toolbar';
|
|
</CodeHighlight>
|
|
|
|
<h3>Getting Started</h3>
|
|
<p>Toolbar provides <i>left</i> and <i>right</i> templates to place content at these sections.</p>
|
|
<CodeHighlight>
|
|
<Toolbar>
|
|
<template slot="left">
|
|
<Button label="New" icon="pi pi-plus" style="margin-right: .25em" />
|
|
<Button label="Upload" icon="pi pi-upload" class="p-button-success" />
|
|
<i class="pi pi-bars p-toolbar-separator" style="margin-right: .25em" />
|
|
<SplitButton label="Save" icon="pi pi-check" :model="items" class="p-button-warning"></SplitButton>
|
|
</template>
|
|
|
|
<template slot="right">
|
|
<Button icon="pi pi-search" style="margin-right: .25em" />
|
|
<Button icon="pi pi-calendar" class="p-button-success" style="margin-right: .25em" />
|
|
<Button icon="pi pi-times" class="p-button-danger" />
|
|
</template>
|
|
</Toolbar>
|
|
</CodeHighlight>
|
|
|
|
<h3>Styling</h3>
|
|
<p>Following is the list of structural style classes, for theming classes visit <router-link to="/theming">theming</router-link> page.</p>
|
|
<div class="doc-tablewrapper">
|
|
<table class="doc-table">
|
|
<thead>
|
|
<tr>
|
|
<th>Name</th>
|
|
<th>Element</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>p-toolbar</td>
|
|
<td>Main container element.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>p-toolbar-group-left</td>
|
|
<td>Left content container.</td>
|
|
</tr>
|
|
<tr>
|
|
<td>p-toolbar-group-right</td>
|
|
<td>Right content container.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
<h3>Dependencies</h3>
|
|
<p>None.</p>
|
|
</TabPanel>
|
|
|
|
<TabPanel header="Source">
|
|
<a href="https://github.com/primefaces/primevue/tree/master/src/views/toolbar" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
|
<span>View on GitHub</span>
|
|
</a>
|
|
<CodeHighlight>
|
|
<template v-pre>
|
|
<template>
|
|
<div>
|
|
<div class="content-section introduction">
|
|
<div class="feature-intro">
|
|
<h1>Toolbar</h1>
|
|
<p>Toolbar is a grouping component for buttons and other content.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="content-section implementation">
|
|
<Toolbar>
|
|
<template slot="left">
|
|
<Button label="New" icon="pi pi-plus" style="margin-right: .25em" />
|
|
<Button label="Upload" icon="pi pi-upload" class="p-button-success" />
|
|
<i class="pi pi-bars p-toolbar-separator" style="margin-right: .25em" />
|
|
<Button label="Save" icon="pi pi-check" class="p-button-warning" />
|
|
</template>
|
|
|
|
<template slot="right">
|
|
<Button icon="pi pi-search" style="margin-right: .25em" />
|
|
<Button icon="pi pi-calendar" class="p-button-success" style="margin-right: .25em" />
|
|
<Button icon="pi pi-times" class="p-button-danger" />
|
|
</template>
|
|
</Toolbar>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
</CodeHighlight>
|
|
|
|
<CodeHighlight lang="javascript">
|
|
export default {
|
|
data() {
|
|
return {
|
|
items: [
|
|
{
|
|
label: 'Update',
|
|
icon: 'pi pi-refresh'
|
|
},
|
|
{
|
|
label: 'Delete',
|
|
icon: 'pi pi-times'
|
|
},
|
|
{
|
|
label: 'Vue Website',
|
|
icon: 'pi pi-external-link',
|
|
command: () => {
|
|
window.location.href = 'https://vuejs.org/'
|
|
}
|
|
},
|
|
{ label: 'Upload',
|
|
icon: 'pi pi-upload',
|
|
command: () => {
|
|
window.location.hash = "/fileupload"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
}
|
|
}
|
|
</CodeHighlight>
|
|
</TabPanel>
|
|
</TabView>
|
|
</div>
|
|
</template> |