2019-03-28 08:22:25 +00:00
|
|
|
<template>
|
|
|
|
<div class="content-section documentation">
|
|
|
|
<TabView>
|
|
|
|
<TabPanel header="Documentation">
|
|
|
|
<h3>Import</h3>
|
|
|
|
<CodeHighlight lang="javascript">
|
|
|
|
import Button from 'primevue/button';
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Getting Started</h3>
|
|
|
|
<p>Button is created using the Button element.</p>
|
|
|
|
<CodeHighlight>
|
|
|
|
<Button />
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Label</h3>
|
|
|
|
<p>Text of the button is defined using the <i>label</i> property.</p>
|
|
|
|
<CodeHighlight>
|
2020-05-04 23:13:04 +00:00
|
|
|
<Button label="Submit" />
|
2019-03-28 08:22:25 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
<h3>Icons</h3>
|
|
|
|
<p>Icon on a button is specified with <i>icon</i> property and position is configured using <i>iconPos</i> attribute. Default
|
2019-05-23 08:24:32 +00:00
|
|
|
icon position is "left" and alternative is "right". To display only an icon, leave the label as undefined.</p>
|
2019-03-28 08:22:25 +00:00
|
|
|
<CodeHighlight>
|
2020-05-04 23:13:04 +00:00
|
|
|
<Button label="Submit" icon="pi pi-check" iconPos="right" />
|
2019-03-28 08:22:25 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Events</h3>
|
|
|
|
<p>Events are defined with the standard notation.</p>
|
|
|
|
<CodeHighlight>
|
2020-05-04 23:13:04 +00:00
|
|
|
<Button label="Submit" @click="handleClick($event)"/>
|
2019-03-28 08:22:25 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Severity</h3>
|
|
|
|
<p>Different color options are available as severity levels.</p>
|
|
|
|
|
|
|
|
<ul>
|
|
|
|
<li>.p-button-secondary</li>
|
|
|
|
<li>.p-button-success</li>
|
|
|
|
<li>.p-button-info</li>
|
|
|
|
<li>.p-button-warning</li>
|
|
|
|
<li>.p-button-danger</li>
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
<CodeHighlight>
|
2019-05-22 16:30:18 +00:00
|
|
|
<Button label="Primary" />
|
|
|
|
<Button label="Secondary" class="p-button-secondary" />
|
|
|
|
<Button label="Success" class="p-button-success" />
|
|
|
|
<Button label="Info" class="p-button-info" />
|
|
|
|
<Button label="Warning" class="p-button-warning" />
|
|
|
|
<Button label="Danger" class="p-button-danger" />
|
2019-03-28 08:22:25 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Raised and Rounded Buttons</h3>
|
|
|
|
<p>A button can be raised by having "p-button-raised" style class and similarly borders can be made rounded using "p-button-rounded" class.</p>
|
|
|
|
<CodeHighlight>
|
2019-05-22 16:30:18 +00:00
|
|
|
<Button label="Primary" class="p-button-raised p-button-rounded" />
|
2020-04-28 09:34:12 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>ButtonSet</h3>
|
|
|
|
<p>Wrapping the buttons in a container having a <i>.p-buttonset</i> class, groups the buttons side to side.</p>
|
|
|
|
<CodeHighlight>
|
|
|
|
<span class="p-buttonset">
|
|
|
|
<Button label="Save" icon="pi pi-check" />
|
|
|
|
<Button label="Delete" icon="pi pi-trash" />
|
|
|
|
<Button label="Cancel" icon="pi pi-times" />
|
|
|
|
</span>
|
2019-03-28 08:22:25 +00:00
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<h3>Properties</h3>
|
2020-01-13 09:04:50 +00:00
|
|
|
<p>Any property such as style and class are passed to the underlying button element. Following are the additional properties to configure the component.</p>
|
2019-03-28 08:22:25 +00:00
|
|
|
<div class="doc-tablewrapper">
|
|
|
|
<table class="doc-table">
|
|
|
|
<thead>
|
2019-05-23 08:24:32 +00:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Type</th>
|
|
|
|
<th>Default</th>
|
|
|
|
<th>Description</th>
|
|
|
|
</tr>
|
2019-03-28 08:22:25 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2019-05-23 08:24:32 +00:00
|
|
|
<tr>
|
|
|
|
<td>label</td>
|
|
|
|
<td>string</td>
|
|
|
|
<td>null</td>
|
|
|
|
<td>Text of the button.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>icon</td>
|
|
|
|
<td>string</td>
|
|
|
|
<td>null</td>
|
|
|
|
<td>Name of the icon.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>iconPos</td>
|
|
|
|
<td>string</td>
|
|
|
|
<td>left</td>
|
|
|
|
<td>Position of the icon, valid values are "left" and "right".</td>
|
|
|
|
</tr>
|
2019-03-28 08:22:25 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<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>
|
2020-04-28 09:34:12 +00:00
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Element</th>
|
|
|
|
</tr>
|
2019-03-28 08:22:25 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
2020-04-28 09:34:12 +00:00
|
|
|
<tr>
|
|
|
|
<td>p-button</td>
|
|
|
|
<td>Button element</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-button-icon</td>
|
|
|
|
<td>Icon element</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>p-button-text</td>
|
|
|
|
<td>Label element of the button</td>
|
|
|
|
</tr>
|
2019-03-28 08:22:25 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h3>Dependencies</h3>
|
|
|
|
<p>None.</p>
|
|
|
|
</TabPanel>
|
|
|
|
|
|
|
|
<TabPanel header="Source">
|
|
|
|
<a href="https://github.com/primefaces/primevue/tree/master/src/views/button" class="btn-viewsource" target="_blank" rel="noopener noreferrer">
|
|
|
|
<span>View on GitHub</span>
|
|
|
|
</a>
|
|
|
|
<CodeHighlight>
|
|
|
|
<template v-pre>
|
2019-08-04 12:19:34 +00:00
|
|
|
<h3>Basic</h3>
|
2020-05-04 23:13:04 +00:00
|
|
|
<Button label="Submit" />
|
|
|
|
<Button label="Submit" icon="pi pi-check" />
|
|
|
|
<Button label="Submit" icon="pi pi-check" iconPos="right" />
|
2019-08-04 12:19:34 +00:00
|
|
|
<Button icon="pi pi-check" />
|
2020-05-04 23:13:04 +00:00
|
|
|
<Button label="Submit" disabled="disabled" />
|
2019-03-28 08:22:25 +00:00
|
|
|
|
2019-08-04 12:19:34 +00:00
|
|
|
<h3>Severities</h3>
|
|
|
|
<Button label="Primary" />
|
|
|
|
<Button label="Secondary" class="p-button-secondary" />
|
|
|
|
<Button label="Success" class="p-button-success" />
|
|
|
|
<Button label="Info" class="p-button-info" />
|
|
|
|
<Button label="Warning" class="p-button-warning" />
|
|
|
|
<Button label="Danger" class="p-button-danger" />
|
2019-03-28 08:22:25 +00:00
|
|
|
|
2019-08-04 12:19:34 +00:00
|
|
|
<h3>Raised Buttons</h3>
|
|
|
|
<Button label="Primary" class="p-button-raised" />
|
|
|
|
<Button label="Secondary" class="p-button-raised p-button-secondary" />
|
|
|
|
<Button label="Success" class="p-button-raised p-button-success" />
|
|
|
|
<Button label="Info" class="p-button-raised p-button-info" />
|
|
|
|
<Button label="Warning" class="p-button-raised p-button-warning" />
|
|
|
|
<Button label="Danger" class="p-button-raised p-button-danger" />
|
|
|
|
|
|
|
|
<h3>Rounded Buttons</h3>
|
|
|
|
<Button label="Primary" class="p-button-rounded" />
|
|
|
|
<Button label="Secondary" class="p-button-rounded p-button-secondary" />
|
|
|
|
<Button label="Success" class="p-button-rounded p-button-success" />
|
|
|
|
<Button label="Info" class="p-button-rounded p-button-info" />
|
|
|
|
<Button label="Warning" class="p-button-rounded p-button-warning" />
|
|
|
|
<Button label="Danger" class="p-button-rounded p-button-danger" />
|
2020-04-28 09:34:12 +00:00
|
|
|
|
|
|
|
<h3>ButtonSet</h3>
|
|
|
|
<span class="p-buttonset">
|
|
|
|
<Button label="Save" icon="pi pi-check" />
|
|
|
|
<Button label="Delete" icon="pi pi-trash" />
|
|
|
|
<Button label="Cancel" icon="pi pi-times" />
|
|
|
|
</span>
|
2020-05-05 10:35:18 +00:00
|
|
|
|
|
|
|
<h3>Sizes</h3>
|
|
|
|
<div class="component-sizes">
|
|
|
|
<Button label="Small" icon="pi pi-check" class="p-component-sm" />
|
|
|
|
<Button label="Normal" icon="pi pi-check" />
|
|
|
|
<Button icon="pi pi-check" label="Large" class="p-component-lg" />
|
|
|
|
</div>
|
2019-03-28 08:22:25 +00:00
|
|
|
</template>
|
|
|
|
</CodeHighlight>
|
|
|
|
|
|
|
|
<CodeHighlight lang="css">
|
|
|
|
button {
|
|
|
|
margin-right: .5em;
|
|
|
|
}
|
|
|
|
</CodeHighlight>
|
|
|
|
</TabPanel>
|
|
|
|
</TabView>
|
|
|
|
</div>
|
|
|
|
</template>
|