gctGenerator/docs/.vuepress/components/ButtonComponent.vue

56 lines
1,006 B
Vue
Raw Normal View History

2020-06-28 07:05:33 +09:00
<template>
2020-06-29 00:35:18 +09:00
<div :class="disabled ? 'button-wrapper disabled' : 'button-wrapper'">
2020-06-28 11:51:06 +09:00
<button @click="onClick" :disabled="disabled">{{ label }}</button>
2020-06-28 07:05:33 +09:00
</div>
</template>
<script>
2020-06-29 00:35:18 +09:00
import CodeFormatter from './scripts/codeFormatter';
2020-06-28 07:05:33 +09:00
export default {
props: {
disabled: { type: Boolean },
onClick: { type: Function },
2020-06-29 00:35:18 +09:00
label: { type: String },
},
2020-06-28 07:05:33 +09:00
};
</script>
<style scoped>
.button-wrapper {
position: relative;
2020-06-29 00:35:18 +09:00
display: inline-block;
2020-06-28 07:05:33 +09:00
max-width: 400px;
min-width: 180px;
2020-06-29 00:35:18 +09:00
width: 100%;
2020-06-28 07:05:33 +09:00
}
.button-wrapper.disabled button {
background-color: rgb(165, 165, 165);
cursor: not-allowed;
}
button {
border: none;
outline: none;
background-color: #2eb9e2;
-webkit-appearance: none;
-moz-appearance: none;
appearance: none;
border-radius: 0;
margin: 0;
display: block;
width: 100%;
padding: 6px 15px;
font-size: 14px;
color: white;
font-weight: bold;
cursor: pointer;
2020-06-29 00:35:18 +09:00
text-align: center;
2020-06-28 07:05:33 +09:00
}
button:hover {
background-color: #3fc1e9;
}
</style>