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

@@ -21,35 +21,33 @@ import { ROUTE_HOME } from '@/router';
import { useReloadInject } from '@/context';
import { dynamicIconRender } from '@/utils';
interface Props {
/** 右键菜单可见性 */
visible?: boolean;
/** 当前是否是路由首页 */
isRouteHome?: boolean;
/** 当前路由路径 */
currentPath?: string;
/** 鼠标x坐标 */
x: number;
/** 鼠标y坐标 */
y: number;
}
type DropdownKey = 'reload-current' | 'close-current' | 'close-other' | 'close-all';
type Option = DropdownOption & {
key: DropdownKey;
};
const props = defineProps({
visible: {
type: Boolean,
default: false
},
isRouteHome: {
type: Boolean,
default: false
},
currentPath: {
type: String,
default: ''
},
x: {
type: Number,
required: true
},
y: {
type: Number,
required: true
}
const props = withDefaults(defineProps<Props>(), {
visible: false,
isRouteHome: false,
currentPath: ''
});
const emit = defineEmits(['update:visible']);
const emit = defineEmits<{
(e: 'update:visible', visible: boolean): void;
}>();
const app = useAppStore();
const { removeMultiTab, clearMultiTab } = useAppStore();

View File

@@ -24,11 +24,13 @@ import { useThemeStore, useAppStore } from '@/store';
import { BetterScroll } from '@/components';
import { MultiTab, ReloadButton } from './components';
defineProps({
zIndex: {
type: Number,
default: 0
}
interface Props {
/** 层级z-index */
zIndex?: number;
}
withDefaults(defineProps<Props>(), {
zIndex: 0
});
const route = useRoute();