feat(projects): 添加多页签风格:按钮和浏览器两种风格

This commit is contained in:
Soybean
2021-09-20 02:48:53 +08:00
parent 03ebd49c86
commit 3cfa0f103c
40 changed files with 601 additions and 167 deletions

View File

@ -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 };

View 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
};
}

View File

@ -1,2 +1,2 @@
export { useAppTitle, useContext, useRouterChange, useRouteParam, useRouteQuery } from './common';
export { useAppTitle, useContext, useRouterChange, useRouteParam, useRouteQuery, useBoolean } from './common';
export { useCountDown, useSmsCode } from './business';