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

@@ -1,27 +1,29 @@
<template>
<div class="absolute-lt wh-full overflow-hidden">
<div class="absolute -right-300px -top-900px">
<corner-top :start-color="firstColor" :end-color="secondColor" />
<corner-top :start-color="themeColor" :end-color="stopColor" />
</div>
<div class="absolute -left-200px -bottom-400px">
<corner-bottom :start-color="firstColor" :end-color="secondColor" />
<corner-bottom :start-color="themeColor" :end-color="stopColor" />
</div>
</div>
</template>
<script lang="ts" setup>
import { computed } from 'vue';
import { brightenColor, darkenColor } from '@/utils';
import { mixColor } from '@/utils';
import { CornerTop, CornerBottom } from './components';
const props = defineProps({
themeColor: {
type: String,
default: '#409EFF'
}
interface Props {
/** 主题颜色 */
themeColor?: string;
}
const props = withDefaults(defineProps<Props>(), {
themeColor: '#409EFF'
});
const firstColor = computed(() => darkenColor(props.themeColor));
const secondColor = computed(() => brightenColor(props.themeColor));
const COLOR_WHITE = '#ffffff';
const stopColor = computed(() => mixColor(COLOR_WHITE, props.themeColor, 0.7));
</script>
<style scoped></style>