refactor(projects): 添加exportDefaults替换defineProps

This commit is contained in:
Soybean
2021-11-07 01:23:01 +08:00
committed by Soybean
parent 43b832bee0
commit e61ee32a88
42 changed files with 886 additions and 970 deletions

View File

@ -22,27 +22,29 @@
<script lang="ts" setup>
import { computed } from 'vue';
import type { Component, PropType } from 'vue';
import type { Component } from 'vue';
import { NCard, NGradientText } from 'naive-ui';
import { SystemLogo, LoginBg } from '@/components';
import { useAppTitle } from '@/hooks';
import { EnumLoginModule } from '@/enum';
import { addColorAlpha } from '@/utils';
import { mixColor } from '@/utils';
import type { LoginModuleType } from '@/interface';
import { PwdLogin, CodeLogin, Register, ResetPwd, BindWechat } from './components';
import { useThemeStore } from '@/store';
interface Props {
/** 登录模块分类 */
module?: LoginModuleType;
}
interface LoginModule {
key: LoginModuleType;
label: string;
component: Component;
}
defineProps({
module: {
type: String as PropType<LoginModuleType>,
default: 'pwd-login'
}
withDefaults(defineProps<Props>(), {
module: 'pwd-login'
});
const theme = useThemeStore();
@ -56,7 +58,7 @@ const modules: LoginModule[] = [
{ key: 'bind-wechat', label: EnumLoginModule['bind-wechat'], component: BindWechat }
];
const bgColor = computed(() => addColorAlpha(theme.themeColor, 0.1));
const bgColor = computed(() => mixColor('#ffffff', theme.themeColor, 0.3));
</script>
<style scoped>
.login-bg {