Button doc added
parent
b15e2372f5
commit
52e9deb918
|
@ -39,9 +39,21 @@
|
||||||
<Button label="Warning" class="p-button-rounded p-button-warning" />
|
<Button label="Warning" class="p-button-rounded p-button-warning" />
|
||||||
<Button label="Danger" class="p-button-rounded p-button-danger" />
|
<Button label="Danger" class="p-button-rounded p-button-danger" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<ButtonDoc/>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import ButtonDoc from './ButtonDoc'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: {
|
||||||
|
'ButtonDoc': ButtonDoc
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
button {
|
button {
|
||||||
margin-right: .5em;
|
margin-right: .5em;
|
||||||
|
|
|
@ -0,0 +1,185 @@
|
||||||
|
<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>
|
||||||
|
<Button label="Click" />
|
||||||
|
</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
|
||||||
|
icon position is "left" and alternative is "right". To display only an icon, leave label as undefined.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<Button label="Click" icon="pi pi-check" iconPos="right" />
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Events</h3>
|
||||||
|
<p>Events are defined with the standard notation.</p>
|
||||||
|
<CodeHighlight>
|
||||||
|
<Button label="Click" @click="handleClick($event)"/>
|
||||||
|
</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>
|
||||||
|
<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" />
|
||||||
|
</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>
|
||||||
|
<Button label="Primary" class="p-button-raised p-button-rounded" />
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<div class="doc-tablewrapper">
|
||||||
|
<table class="doc-table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Default</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<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>
|
||||||
|
</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>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Element</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<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>
|
||||||
|
</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>
|
||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="content-section introduction">
|
||||||
|
<div class="feature-intro">
|
||||||
|
<h1>Button</h1>
|
||||||
|
<p>Button is an extension to standard button element with icons and theming.</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content-section implementation">
|
||||||
|
<h3 class="first">Basic</h3>
|
||||||
|
<Button label="Click" />
|
||||||
|
<Button label="Click" icon="pi pi-check" />
|
||||||
|
<Button label="Click" icon="pi pi-check" iconPos="right" />
|
||||||
|
<Button icon="pi pi-check" />
|
||||||
|
<Button label="Click" disabled="disabled" />
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
|
||||||
|
<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" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</template>
|
||||||
|
</CodeHighlight>
|
||||||
|
|
||||||
|
<CodeHighlight lang="css">
|
||||||
|
button {
|
||||||
|
margin-right: .5em;
|
||||||
|
}
|
||||||
|
</CodeHighlight>
|
||||||
|
</TabPanel>
|
||||||
|
</TabView>
|
||||||
|
</div>
|
||||||
|
</template>
|
Loading…
Reference in New Issue