2
0
mirror of https://github.com/frappe/books.git synced 2025-02-14 17:56:34 +00:00
books/src/components/Button.vue

48 lines
970 B
Vue
Raw Normal View History

2019-10-04 23:51:26 +05:30
<template>
<button
class="focus:outline-none rounded-md shadow-button flex-center"
:style="style"
:class="_class"
v-bind="$attrs"
v-on="$listeners"
>
2019-10-04 23:51:26 +05:30
<slot></slot>
</button>
</template>
2019-10-05 01:48:10 +05:30
<script>
export default {
name: 'Button',
props: {
type: {
type: String,
default: 'secondary'
},
icon: {
type: Boolean,
default: false
},
disabled: {
type: Boolean,
default: false
2019-10-05 01:48:10 +05:30
}
},
computed: {
style() {
return {
padding: this.icon ? '6px 12px' : '6px 24px',
color: this.type === 'primary' ? '#fff' : '#000',
'background-image':
this.type === 'primary'
2019-10-24 16:55:53 +05:30
? 'linear-gradient(180deg, #2C9AF1 0%, #2490EF 100%)'
: 'linear-gradient(180deg, #F9F9FA 0%, #F4F4F6 100%)',
};
},
_class() {
return {
'opacity-50 cursor-not-allowed pointer-events-none': this.disabled
};
2019-10-05 01:48:10 +05:30
}
}
};
2019-10-05 01:48:10 +05:30
</script>