2019-10-04 23:51:26 +05:30
|
|
|
<template>
|
2019-10-13 17:33:01 +05:30
|
|
|
<button
|
2022-05-01 17:04:13 +05:30
|
|
|
class="focus:outline-none rounded-md shadow-button flex-center h-8"
|
2019-10-13 17:33:01 +05:30
|
|
|
:style="style"
|
2019-12-16 19:22:14 +05:30
|
|
|
:class="_class"
|
2019-10-13 17:33:01 +05:30
|
|
|
v-bind="$attrs"
|
|
|
|
>
|
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,
|
2022-02-07 16:56:27 +05:30
|
|
|
default: 'secondary',
|
2019-10-14 02:49:28 +05:30
|
|
|
},
|
|
|
|
icon: {
|
|
|
|
type: Boolean,
|
2022-02-07 16:56:27 +05:30
|
|
|
default: false,
|
2019-12-16 19:22:14 +05:30
|
|
|
},
|
|
|
|
disabled: {
|
|
|
|
type: Boolean,
|
2022-02-07 16:56:27 +05:30
|
|
|
default: false,
|
|
|
|
},
|
2022-02-21 16:26:57 +05:30
|
|
|
padding: {
|
|
|
|
type: Boolean,
|
|
|
|
default: true,
|
|
|
|
},
|
2019-10-05 01:48:10 +05:30
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
style() {
|
|
|
|
return {
|
2022-02-21 16:26:57 +05:30
|
|
|
...(this.padding
|
|
|
|
? { padding: this.icon ? '6px 12px' : '6px 24px' }
|
|
|
|
: {}),
|
2021-12-21 11:50:04 +05:30
|
|
|
color: this.type === 'primary' ? '#fff' : '#112B42',
|
2019-10-06 03:11:16 +05:30
|
|
|
'background-image':
|
|
|
|
this.type === 'primary'
|
2019-10-24 16:55:53 +05:30
|
|
|
? 'linear-gradient(180deg, #2C9AF1 0%, #2490EF 100%)'
|
2021-12-14 23:44:48 +05:30
|
|
|
: 'linear-gradient(180deg, #F9F9FA 0%, #F4F4F6 100%)',
|
2019-10-06 03:11:16 +05:30
|
|
|
};
|
2019-12-16 19:22:14 +05:30
|
|
|
},
|
|
|
|
_class() {
|
|
|
|
return {
|
2022-02-07 16:56:27 +05:30
|
|
|
'opacity-50 cursor-not-allowed pointer-events-none': this.disabled,
|
2019-12-16 19:22:14 +05:30
|
|
|
};
|
2022-02-07 16:56:27 +05:30
|
|
|
},
|
|
|
|
},
|
2019-10-06 03:11:16 +05:30
|
|
|
};
|
2019-10-05 01:48:10 +05:30
|
|
|
</script>
|
2022-02-07 16:56:27 +05:30
|
|
|
<style scoped>
|
|
|
|
button:focus {
|
|
|
|
filter: brightness(0.95);
|
|
|
|
}
|
|
|
|
</style>
|