mirror of
https://github.com/Hopiu/vue-material.git
synced 2026-05-08 23:44:44 +00:00
492 lines
18 KiB
Vue
492 lines
18 KiB
Vue
<template>
|
|
<page-content page-title="Components - Button">
|
|
<docs-component>
|
|
<div slot="description">
|
|
<p>Buttons communicate the action that will occur when the user touches them.</p>
|
|
<p>The following classes can be applied to change the color palette:</p>
|
|
<ul class="md-body-2">
|
|
<li><code>md-primary</code></li>
|
|
<li><code>md-accent</code></li>
|
|
<li><code>md-warn</code></li>
|
|
</ul>
|
|
</div>
|
|
|
|
<div slot="api">
|
|
<api-table name="md-button">
|
|
<md-table slot="properties">
|
|
<md-table-header>
|
|
<md-table-row>
|
|
<md-table-head>Name</md-table-head>
|
|
<md-table-head>Type</md-table-head>
|
|
<md-table-head>Description</md-table-head>
|
|
</md-table-row>
|
|
</md-table-header>
|
|
|
|
<md-table-body>
|
|
<md-table-row>
|
|
<md-table-cell>disabled</md-table-cell>
|
|
<md-table-cell><code>Boolean</code></md-table-cell>
|
|
<md-table-cell>Disable the button and prevent its actions. Default <code>false</code></md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>type</md-table-cell>
|
|
<md-table-cell><code>String</code></md-table-cell>
|
|
<md-table-cell>Apply a type to button - Doesn't apply for links.</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>href</md-table-cell>
|
|
<md-table-cell><code>String</code></md-table-cell>
|
|
<md-table-cell>Create a anchor on the button - In this case the generated tag will be <code><a></code>.</md-table-cell>
|
|
</md-table-row>
|
|
</md-table-body>
|
|
</md-table>
|
|
|
|
<md-table slot="classes">
|
|
<md-table-header>
|
|
<md-table-row>
|
|
<md-table-head>Name</md-table-head>
|
|
<md-table-head>Description</md-table-head>
|
|
</md-table-row>
|
|
</md-table-header>
|
|
|
|
<md-table-body>
|
|
<md-table-row>
|
|
<md-table-cell>md-raised</md-table-cell>
|
|
<md-table-cell>Raised button</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-icon-button</md-table-cell>
|
|
<md-table-cell>Create rounded buttons - Need a <md-icon> inside</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-dense</md-table-cell>
|
|
<md-table-cell>Small dense buttons</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-fab</md-table-cell>
|
|
<md-table-cell>Create an Floating Action Button</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-mini</md-table-cell>
|
|
<md-table-cell>Small md-fab</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-fab-top-left</md-table-cell>
|
|
<md-table-cell>Position the md-fab absolutely on the top left of its parent</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-fab-top-center</md-table-cell>
|
|
<md-table-cell>Position the md-fab absolutely on the top center of its parent</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-fab-top-right</md-table-cell>
|
|
<md-table-cell>Position the md-fab absolutely on the top right of its parent</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-fab-bottom-left</md-table-cell>
|
|
<md-table-cell>Position the md-fab absolutely on the bottom left of its parent</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-fab-bottom-center</md-table-cell>
|
|
<md-table-cell>Position the md-fab absolutely on the bottom center of its parent</md-table-cell>
|
|
</md-table-row>
|
|
|
|
<md-table-row>
|
|
<md-table-cell>md-fab-bottom-right</md-table-cell>
|
|
<md-table-cell>Position the md-fab absolutely on the bottom right of its parent</md-table-cell>
|
|
</md-table-row>
|
|
</md-table-body>
|
|
</md-table>
|
|
|
|
<md-table slot="events">
|
|
<md-table-header>
|
|
<md-table-row>
|
|
<md-table-head>Name</md-table-head>
|
|
<md-table-head>Value</md-table-head>
|
|
<md-table-head>Description</md-table-head>
|
|
</md-table-row>
|
|
</md-table-header>
|
|
|
|
<md-table-body>
|
|
<md-table-row>
|
|
<md-table-cell>click</md-table-cell>
|
|
<md-table-cell>Receive the click event</md-table-cell>
|
|
<md-table-cell>Triggered when an item is clicked.</md-table-cell>
|
|
</md-table-row>
|
|
</md-table-body>
|
|
</md-table>
|
|
</api-table>
|
|
</div>
|
|
|
|
<div slot="example">
|
|
<example-box card-title="Flat">
|
|
<div slot="demo">
|
|
<md-button>Default</md-button>
|
|
<md-button class="md-primary">Primary</md-button>
|
|
<md-button class="md-accent">Accent</md-button>
|
|
<md-button class="md-warn">Warn</md-button>
|
|
<md-button class="md-primary" disabled>Disabled</md-button>
|
|
<md-button class="md-dense">Dense</md-button>
|
|
</div>
|
|
|
|
<div slot="code">
|
|
<code-block lang="xml">
|
|
<md-button>Default</md-button>
|
|
<md-button class="md-primary">Primary</md-button>
|
|
<md-button class="md-accent">Accent</md-button>
|
|
<md-button class="md-warn">Warn</md-button>
|
|
<md-button class="md-primary" disabled>Disabled</md-button>
|
|
<md-button class="md-dense">Dense</md-button>
|
|
</code-block>
|
|
</div>
|
|
</example-box>
|
|
|
|
<example-box card-title="Raised">
|
|
<div slot="demo">
|
|
<md-button class="md-raised">Default</md-button>
|
|
<md-button class="md-raised md-primary">Primary</md-button>
|
|
<md-button class="md-raised md-accent">Accent</md-button>
|
|
<md-button class="md-raised md-warn">Warn</md-button>
|
|
<md-button class="md-raised md-primary" disabled>Disabled</md-button>
|
|
<md-button class="md-raised md-dense">Dense</md-button>
|
|
</div>
|
|
|
|
<div slot="code">
|
|
<code-block lang="xml">
|
|
<md-button class="md-raised">Default</md-button>
|
|
<md-button class="md-raised md-primary">Primary</md-button>
|
|
<md-button class="md-raised md-accent">Accent</md-button>
|
|
<md-button class="md-raised md-warn">Warn</md-button>
|
|
<md-button class="md-raised md-primary" disabled>Disabled</md-button>
|
|
<md-button class="md-raised md-dense">Dense</md-button>
|
|
</code-block>
|
|
</div>
|
|
</example-box>
|
|
|
|
<example-box card-title="Button vs Link vs Router Link">
|
|
<div slot="demo">
|
|
<md-button class="md-raised md-primary">Button</md-button>
|
|
<md-button href="#/components/button" class="md-raised md-primary">Link</md-button>
|
|
<router-link tag="md-button" to="/components/button" class="md-raised md-primary">Router Link</router-link>
|
|
</div>
|
|
|
|
<div slot="code">
|
|
<code-block lang="xml">
|
|
<md-button class="md-raised md-primary">Button</md-button>
|
|
<md-button href="#/components/button" class="md-raised md-primary">Link</md-button>
|
|
<router-link tag="md-button" to="/components/button" class="md-raised md-primary">Router Link</router-link>
|
|
</code-block>
|
|
</div>
|
|
</example-box>
|
|
|
|
<example-box card-title="Icons - Flat">
|
|
<div slot="demo">
|
|
<md-button class="md-icon-button">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-primary">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-accent">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-warn">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button" disabled>
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-dense">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
</div>
|
|
|
|
<div slot="code">
|
|
<code-block lang="xml">
|
|
<md-button class="md-icon-button">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-primary">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-accent">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-warn">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button" disabled>
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-dense">
|
|
<md-icon>more_vert</md-icon>
|
|
</md-button>
|
|
</code-block>
|
|
</div>
|
|
</example-box>
|
|
|
|
<example-box card-title="Icons - Raised">
|
|
<div slot="demo">
|
|
<md-button class="md-icon-button md-raised">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised md-primary">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised md-accent">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised md-warn">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised" disabled>
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised md-dense">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
</div>
|
|
|
|
<div slot="code">
|
|
<code-block lang="xml">
|
|
<md-button class="md-icon-button md-raised">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised md-primary">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised md-accent">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised md-warn">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised" disabled>
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-icon-button md-raised md-dense">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
</code-block>
|
|
</div>
|
|
</example-box>
|
|
|
|
<example-box card-title="Floating Action Button">
|
|
<div class="fab-holder" slot="demo">
|
|
<div>
|
|
<md-button class="md-fab">
|
|
<md-icon>edit</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-primary">
|
|
<md-icon>email</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-warn">
|
|
<md-icon>save</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-clean">
|
|
<md-icon>dialpad</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab" disabled>
|
|
<md-icon>message</md-icon>
|
|
</md-button>
|
|
</div>
|
|
|
|
<div>
|
|
<md-button class="md-fab md-mini">
|
|
<md-icon>edit</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-primary md-mini">
|
|
<md-icon>email</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-warn md-mini">
|
|
<md-icon>save</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-clean md-mini">
|
|
<md-icon>dialpad</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-mini" disabled>
|
|
<md-icon>message</md-icon>
|
|
</md-button>
|
|
</div>
|
|
|
|
<md-button class="md-fab md-fab-bottom-left">
|
|
<md-icon>save</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-primary md-fab-bottom-center">
|
|
<md-icon>dialpad</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-fab-bottom-right">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
</div>
|
|
|
|
<div slot="code">
|
|
<code-block lang="xml">
|
|
<div>
|
|
<md-button class="md-fab">
|
|
<md-icon>edit</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-primary">
|
|
<md-icon>email</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-warn">
|
|
<md-icon>save</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-clean">
|
|
<md-icon>dialpad</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab" disabled>
|
|
<md-icon>message</md-icon>
|
|
</md-button>
|
|
</div>
|
|
|
|
<div>
|
|
<md-button class="md-fab md-mini">
|
|
<md-icon>edit</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-primary md-mini">
|
|
<md-icon>email</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-warn md-mini">
|
|
<md-icon>save</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-clean md-mini">
|
|
<md-icon>dialpad</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-mini" disabled>
|
|
<md-icon>message</md-icon>
|
|
</md-button>
|
|
</div>
|
|
|
|
<md-button class="md-fab md-fab-bottom-left">
|
|
<md-icon>save</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-primary md-fab-bottom-center">
|
|
<md-icon>dialpad</md-icon>
|
|
</md-button>
|
|
|
|
<md-button class="md-fab md-fab-bottom-right">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
</code-block>
|
|
</div>
|
|
</example-box>
|
|
|
|
<example-box card-title="Themes">
|
|
<div slot="demo">
|
|
<md-button md-theme="indigo" class="md-primary">Indigo</md-button>
|
|
|
|
<md-button md-theme="teal" class="md-raised md-primary">Teal</md-button>
|
|
|
|
<md-button md-theme="orange" class="md-icon-button md-primary">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button md-theme="green" class="md-icon-button md-raised md-primary">
|
|
<md-icon>message</md-icon>
|
|
</md-button>
|
|
|
|
<md-button md-theme="brown" class="md-fab md-primary">
|
|
<md-icon>dialpad</md-icon>
|
|
</md-button>
|
|
</div>
|
|
|
|
<div slot="code">
|
|
<code-block lang="xml">
|
|
<md-button md-theme="indigo" class="md-primary">Indigo</md-button>
|
|
|
|
<md-button md-theme="teal" class="md-raised md-primary">Teal</md-button>
|
|
|
|
<md-button md-theme="orange" class="md-icon-button md-primary">
|
|
<md-icon>add</md-icon>
|
|
</md-button>
|
|
|
|
<md-button md-theme="green" class="md-icon-button md-raised md-primary">
|
|
<md-icon>message</md-icon>
|
|
</md-button>
|
|
|
|
<md-button md-theme="brown" class="md-fab md-primary">
|
|
<md-icon>dialpad</md-icon>
|
|
</md-button>
|
|
</code-block>
|
|
</div>
|
|
</example-box>
|
|
</div>
|
|
</docs-component>
|
|
</page-content>
|
|
</template>
|
|
|
|
<style lang="scss" scoped>
|
|
.disabled-button {
|
|
margin-left: 8px;
|
|
}
|
|
|
|
.fab-holder {
|
|
height: 300px;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
buttonDisabled: true
|
|
};
|
|
},
|
|
methods: {
|
|
disablePrimaryButton() {
|
|
this.buttonDisabled = !this.buttonDisabled;
|
|
}
|
|
}
|
|
};
|
|
</script>
|