fix(projects): 修复登录页刷新跳404

This commit is contained in:
Soybean
2021-10-20 16:38:43 +08:00
parent 3edf46eb52
commit 358d4e8a19
15 changed files with 54 additions and 51 deletions

View File

@ -29,7 +29,7 @@
import { computed } from 'vue';
import { useBoolean } from '@/hooks';
import { IconClose } from '@/components';
import { shallowColor } from '@/utils';
import { addColorAlpha } from '@/utils';
const props = defineProps({
isActive: {
@ -62,10 +62,10 @@ const buttonStyle = computed(() => {
const style: { [key: string]: string } = {};
if (props.isActive || isHover.value) {
style.color = props.primaryColor;
style.borderColor = shallowColor(props.primaryColor, 0.3);
style.borderColor = addColorAlpha(props.primaryColor, 0.3);
if (props.isActive) {
const alpha = props.darkMode ? 0.15 : 0.1;
style.backgroundColor = shallowColor(props.primaryColor, alpha);
style.backgroundColor = addColorAlpha(props.primaryColor, alpha);
}
}
return style;

View File

@ -30,7 +30,7 @@
<script setup lang="ts">
import { computed } from 'vue';
import { shallowColor } from '@/utils';
import { addColorAlpha } from '@/utils';
/** 填充的背景颜色: [默认颜色, 暗黑主题颜色] */
type FillColor = [string, string];
@ -66,7 +66,7 @@ const fill = computed(() => {
}
if (props.isActive) {
const alpha = props.darkMode ? 0.15 : 0.1;
color = shallowColor(props.primaryColor, alpha);
color = addColorAlpha(props.primaryColor, alpha);
}
return color;
});