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

@@ -30,26 +30,27 @@ import { useBoolean } from '@/hooks';
import IconClose from '../IconClose/index.vue';
import { SvgRadiusBg } from './components';
defineProps({
isActive: {
type: Boolean,
default: false
},
primaryColor: {
type: String,
default: '#409EFF'
},
closable: {
type: Boolean,
default: true
},
darkMode: {
type: Boolean,
default: false
}
});
interface Props {
/** 激活状态 */
isActive?: boolean;
/** 主题颜色 */
primaryColor?: string;
/** 是否显示关闭图标 */
closable?: boolean;
/** 暗黑模式 */
darkMode?: boolean;
}
const emit = defineEmits(['close']);
withDefaults(defineProps<Props>(), {
isActive: false,
primaryColor: '#409EFF',
closable: true,
darkMode: false
});
const emit = defineEmits<{
/** 点击关闭图标 */
(e: 'close'): void;
}>();
const { bool: isHover, setTrue, setFalse } = useBoolean();