|
|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<button class="ie-button"
|
|
|
- :class="['ie-button', `ie-button-${type}`, `ie-button-${size}`, customClass, { 'is-disabled': disabled || loading, 'has-shadow': hasShadow }]"
|
|
|
+ :class="['ie-button', `ie-button-${type}`, `ie-button-${size}`, customClass, { 'is-disabled': disabled, 'is-loading': loading, 'has-shadow': hasShadow }]"
|
|
|
:disabled="disabled" hover-class="button-hover" :style="getStyle" @click="handleClick">
|
|
|
<uv-loading-icon v-if="loading" color="#FFFFFF" size="16"></uv-loading-icon>
|
|
|
<slot></slot>
|
|
|
@@ -36,6 +36,9 @@ const getStyle = computed(() => {
|
|
|
});
|
|
|
const emit = defineEmits(['click']);
|
|
|
const handleClick = () => {
|
|
|
+ if (props.disabled || props.loading) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
emit('click');
|
|
|
}
|
|
|
</script>
|
|
|
@@ -89,10 +92,22 @@ const handleClick = () => {
|
|
|
}
|
|
|
|
|
|
.is-disabled {
|
|
|
- opacity: 0.8;
|
|
|
+ background: #f7f7f7;
|
|
|
+ color: rgba(0, 0, 0, 0.3);
|
|
|
+ box-shadow: none;
|
|
|
}
|
|
|
|
|
|
-.button-hover:not(.is-disabled) {
|
|
|
+.is-loading {
|
|
|
@apply opacity-80;
|
|
|
}
|
|
|
-</style>
|
|
|
+
|
|
|
+.button-hover:not(.is-disabled):not(.is-loading) {
|
|
|
+ // background: linear-gradient(to right, #2a8dde, #007ae5);
|
|
|
+ @apply opacity-80;
|
|
|
+}
|
|
|
+
|
|
|
+// .is-disabled:hover {
|
|
|
+// background: #f7f7f7;
|
|
|
+// color: rgba(0, 0, 0, 0.3);
|
|
|
+// box-shadow: none;
|
|
|
+// }</style>
|