mirror of
https://github.com/m-xlsea/ruoyi-plus-soybean.git
synced 2025-09-24 07:49:47 +08:00
feat(projects): 添加多页签右键菜单
This commit is contained in:
@ -14,16 +14,14 @@ export default function useReloadContext() {
|
||||
function handleReload() {
|
||||
reload.value = false;
|
||||
nextTick(() => {
|
||||
nextTick(() => {
|
||||
reload.value = true;
|
||||
});
|
||||
reload.value = true;
|
||||
});
|
||||
}
|
||||
|
||||
const context: ReloadContext = {
|
||||
reload,
|
||||
handleReload
|
||||
};
|
||||
|
||||
function useReloadProvide() {
|
||||
useProvide(context);
|
||||
}
|
||||
|
@ -1,3 +1 @@
|
||||
export { setupAppContext, useReloadInject } from './app';
|
||||
|
||||
export { useHoverIndexProvide, useHoverIndexInject } from './part';
|
||||
|
@ -1,5 +0,0 @@
|
||||
import useHoverIndexContext from './useHoverIndexContext';
|
||||
|
||||
const { useHoverIndexProvide, useHoverIndexInject } = useHoverIndexContext();
|
||||
|
||||
export { useHoverIndexProvide, useHoverIndexInject };
|
||||
|
@ -1,39 +0,0 @@
|
||||
import { ref } from 'vue';
|
||||
import type { Ref } from 'vue';
|
||||
import { useContext } from '@/hooks';
|
||||
|
||||
interface HoverIndexContext {
|
||||
/** 被悬浮元素索引 */
|
||||
index: Ref<number>;
|
||||
/** 设置索引 */
|
||||
setHoverIndex(index: number): void;
|
||||
/** 重置索引 */
|
||||
resetHoverIndex(): void;
|
||||
}
|
||||
const { useProvide, useInject: useHoverIndexInject } = useContext<HoverIndexContext>();
|
||||
|
||||
/** 获取被悬浮元素的索引上下文 */
|
||||
export default function useHoverIndexContext() {
|
||||
const index = ref(-1);
|
||||
function setHoverIndex(hIndex: number) {
|
||||
index.value = hIndex;
|
||||
}
|
||||
function resetHoverIndex() {
|
||||
index.value = -1;
|
||||
}
|
||||
|
||||
const context: HoverIndexContext = {
|
||||
index,
|
||||
setHoverIndex,
|
||||
resetHoverIndex
|
||||
};
|
||||
function useHoverIndexProvide() {
|
||||
useProvide(context);
|
||||
}
|
||||
|
||||
return {
|
||||
context,
|
||||
useHoverIndexProvide,
|
||||
useHoverIndexInject
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user