Last active
September 13, 2018 01:24
-
-
Save insign/41c570a4331801441c31a40dcec9ed79 to your computer and use it in GitHub Desktop.
Quasar Dynamic button - buttons for desktop, list for mobile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<q-btn v-if="!$q.platform.is.mobile" | |
@click="$emit('click')" | |
:color="color" | |
:flat="flat" | |
:outline="outline" | |
:icon="icon" | |
:loading="loading" | |
:to="to" | |
> | |
<q-tooltip :offset="[0, 8]">{{ label }}</q-tooltip> | |
</q-btn> | |
<q-item v-else v-close-overlay :class="'text-'+color" @click.native="$emit('click')" :to="to"> | |
<q-spinner v-if="loading"></q-spinner> <q-item-main :label="label"/> | |
</q-item> | |
</template> | |
<script> | |
export default { | |
props: { | |
label: String, | |
icon: String, | |
flat: Boolean, | |
outline: Boolean, | |
loading: Boolean, | |
color: String, | |
to: String, | |
}, | |
} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<q-item-side right v-if="!$q.platform.is.mobile"> | |
<slot></slot> | |
</q-item-side> | |
<q-item-side right v-else-if="loading"> | |
<q-spinner-bars :color="color"></q-spinner-bars> | |
</q-item-side> | |
<q-item-side right v-else icon="mdi-dots-vertical" :color="alert ? 'warning' : color"> | |
<q-popover> | |
<q-list link> | |
<slot></slot> | |
</q-list> | |
</q-popover> | |
</q-item-side> | |
</template> | |
<script> | |
export default { | |
props: { | |
loading: Boolean, | |
alert: Boolean, | |
color: String, | |
}, | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment