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:
@ -3,5 +3,6 @@ import useContext from './useContext';
|
||||
import useRouterChange from './useRouterChange';
|
||||
import useRouteParam from './useRouteParam';
|
||||
import useRouteQuery from './useRouteQuery';
|
||||
import useBoolean from './useBoolean';
|
||||
|
||||
export { useAppTitle, useContext, useRouterChange, useRouteParam, useRouteQuery };
|
||||
export { useAppTitle, useContext, useRouterChange, useRouteParam, useRouteQuery, useBoolean };
|
||||
|
24
src/hooks/common/useBoolean.ts
Normal file
24
src/hooks/common/useBoolean.ts
Normal file
@ -0,0 +1,24 @@
|
||||
import { ref } from 'vue';
|
||||
|
||||
export default function useBoolean(initValue: boolean = false) {
|
||||
const bool = ref(initValue);
|
||||
|
||||
function setTrue() {
|
||||
bool.value = true;
|
||||
}
|
||||
|
||||
function setFalse() {
|
||||
bool.value = false;
|
||||
}
|
||||
|
||||
function toggle() {
|
||||
bool.value = !bool.value;
|
||||
}
|
||||
|
||||
return {
|
||||
bool,
|
||||
setTrue,
|
||||
setFalse,
|
||||
toggle
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user