style(projects): update prettier config

This commit is contained in:
Soybean
2022-04-01 14:47:57 +08:00
parent ca2dfa6185
commit df56abe18d
128 changed files with 2237 additions and 2037 deletions

View File

@ -22,7 +22,7 @@ interface Props {
}
withDefaults(defineProps<Props>(), {
showPadding: true,
showPadding: true
});
const app = useAppStore();

View File

@ -19,17 +19,17 @@ const options = [
{
label: '用户中心',
key: 'user-center',
icon: iconifyRender('carbon:user-avatar'),
icon: iconifyRender('carbon:user-avatar')
},
{
type: 'divider',
key: 'divider',
key: 'divider'
},
{
label: '退出登录',
key: 'logout',
icon: iconifyRender('carbon:logout'),
},
icon: iconifyRender('carbon:logout')
}
];
function handleDropdown(optionKey: string) {
@ -42,7 +42,7 @@ function handleDropdown(optionKey: string) {
negativeText: '取消',
onPositiveClick: () => {
auth.resetAuthStore();
},
}
});
}
}

View File

@ -29,7 +29,7 @@ import {
GithubSite,
FullScreen,
ThemeMode,
UserAvatar,
UserAvatar
} from './components';
interface Props {

View File

@ -60,10 +60,10 @@ const show = computed({
},
set(val: boolean) {
emit('update:value', val);
},
}
});
watch(show, async (val) => {
watch(show, async val => {
if (val) {
/** 自动聚焦 */
await nextTick();
@ -74,7 +74,7 @@ watch(show, async (val) => {
/** 查询 */
function search() {
resultOptions.value = routeStore.searchMenus.filter(
(menu) => keyword.value && menu.meta?.title.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase().trim())
menu => keyword.value && menu.meta?.title.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase().trim())
);
if (resultOptions.value?.length > 0) {
activePath.value = resultOptions.value[0].path;
@ -96,7 +96,7 @@ function handleClose() {
function handleUp() {
const { length } = resultOptions.value;
if (length === 0) return;
const index = resultOptions.value.findIndex((item) => item.path === activePath.value);
const index = resultOptions.value.findIndex(item => item.path === activePath.value);
if (index === 0) {
activePath.value = resultOptions.value[length - 1].path;
} else {
@ -108,7 +108,7 @@ function handleUp() {
function handleDown() {
const { length } = resultOptions.value;
if (length === 0) return;
const index = resultOptions.value.findIndex((item) => item.path === activePath.value);
const index = resultOptions.value.findIndex(item => item.path === activePath.value);
if (index + 1 === length) {
activePath.value = resultOptions.value[0].path;
} else {
@ -120,7 +120,7 @@ function handleDown() {
function handleEnter() {
const { length } = resultOptions.value;
if (length === 0 || activePath.value === '') return;
const routeItem = resultOptions.value.find((item) => item.path === activePath.value);
const routeItem = resultOptions.value.find(item => item.path === activePath.value);
if (routeItem?.meta?.href) {
window.open(activePath.value, '__blank');
} else {

View File

@ -6,7 +6,7 @@
class="bg-[#e5e7eb] dark:bg-dark h-56px mt-8px px-14px rounded-4px cursor-pointer flex-y-center justify-between"
:style="{
background: item.path === active ? theme.themeColor : '',
color: item.path === active ? '#fff' : '',
color: item.path === active ? '#fff' : ''
}"
@click="handleTo"
@mouseenter="handleMouse(item)"
@ -47,7 +47,7 @@ const active = computed({
},
set(val: string) {
emit('update:value', val);
},
}
});
/** 鼠标移入 */

View File

@ -35,7 +35,7 @@ interface Props {
const props = withDefaults(defineProps<Props>(), {
icon: undefined,
isMini: false,
isMini: false
});
const { bool: isHover, setTrue, setFalse } = useBoolean();

View File

@ -42,7 +42,7 @@ function setActiveParentRouteName(routeName: string) {
}
const firstDegreeMenus = computed(() =>
routeStore.menus.map((item) => {
routeStore.menus.map(item => {
const { routeName, label } = item;
const icon = item?.icon;
const hasChildren = Boolean(item.children && item.children.length);
@ -51,13 +51,13 @@ const firstDegreeMenus = computed(() =>
routeName,
label,
icon,
hasChildren,
hasChildren
};
})
);
function getActiveParentRouteName() {
firstDegreeMenus.value.some((item) => {
firstDegreeMenus.value.some(item => {
const routeName = route.name as string;
const flag = routeName?.includes(item.routeName);
if (flag) {
@ -83,7 +83,7 @@ function resetFirstDegreeMenus() {
const activeChildMenus = computed(() => {
const menus: GlobalMenuOption[] = [];
routeStore.menus.some((item) => {
routeStore.menus.some(item => {
const flag = item.routeName === activeParentRouteName.value && Boolean(item.children?.length);
if (flag) {
menus.push(...(item.children || []));

View File

@ -38,7 +38,7 @@ type Option = DropdownOption & {
const props = withDefaults(defineProps<Props>(), {
visible: false,
currentPath: '',
currentPath: ''
});
const emit = defineEmits<Emits>();
@ -52,7 +52,7 @@ const dropdownVisible = computed({
},
set(visible: boolean) {
emit('update:visible', visible);
},
}
});
function hide() {
@ -64,29 +64,29 @@ const options = computed<Option[]>(() => [
label: '重新加载',
key: 'reload-current',
disabled: props.currentPath !== tab.activeTab,
icon: iconifyRender('ant-design:reload-outlined'),
icon: iconifyRender('ant-design:reload-outlined')
},
{
label: '关闭',
key: 'close-current',
disabled: props.currentPath === tab.homeTab.path,
icon: iconifyRender('ant-design:close-outlined'),
icon: iconifyRender('ant-design:close-outlined')
},
{
label: '关闭其他',
key: 'close-other',
icon: iconifyRender('ant-design:column-width-outlined'),
icon: iconifyRender('ant-design:column-width-outlined')
},
{
label: '关闭左侧',
key: 'close-left',
icon: iconifyRender('mdi:format-horizontal-align-left'),
icon: iconifyRender('mdi:format-horizontal-align-left')
},
{
label: '关闭右侧',
key: 'close-right',
icon: iconifyRender('mdi:format-horizontal-align-right'),
},
icon: iconifyRender('mdi:format-horizontal-align-right')
}
]);
const actionMap = new Map<DropdownKey, () => void>([
@ -94,32 +94,32 @@ const actionMap = new Map<DropdownKey, () => void>([
'reload-current',
() => {
app.reloadPage();
},
}
],
[
'close-current',
() => {
tab.removeTab(props.currentPath);
},
}
],
[
'close-other',
() => {
tab.clearTab([props.currentPath]);
},
}
],
[
'close-left',
() => {
tab.clearLeftTab(props.currentPath);
},
}
],
[
'close-right',
() => {
tab.clearRightTab(props.currentPath);
},
],
}
]
]);
function handleDropdown(optionKey: string) {

View File

@ -64,7 +64,7 @@ const dropdown = reactive({
visible: false,
x: 0,
y: 0,
currentPath: '',
currentPath: ''
});
function showDropdown() {
dropdown.visible = true;
@ -92,7 +92,7 @@ watch(
getActiveTabClientX();
},
{
immediate: true,
immediate: true
}
);

View File

@ -44,23 +44,23 @@ const layoutConfig: LayoutConfig = {
vertical: {
placement: 'bottom-start',
menuClass: 'w-1/3 h-full',
mainClass: 'w-2/3 h-3/4',
mainClass: 'w-2/3 h-3/4'
},
'vertical-mix': {
placement: 'bottom',
menuClass: 'w-1/4 h-full',
mainClass: 'w-2/3 h-3/4',
mainClass: 'w-2/3 h-3/4'
},
horizontal: {
placement: 'bottom',
menuClass: 'w-full h-1/4',
mainClass: 'w-full h-3/4',
mainClass: 'w-full h-3/4'
},
'horizontal-mix': {
placement: 'bottom-end',
menuClass: 'w-full h-1/4',
mainClass: 'w-2/3 h-3/4',
},
mainClass: 'w-2/3 h-3/4'
}
};
const activeConfig = computed(() => layoutConfig[props.mode]);

View File

@ -17,7 +17,7 @@ interface Props {
}
const props = withDefaults(defineProps<Props>(), {
iconClass: 'text-14px',
iconClass: 'text-14px'
});
const whiteColors = ['#ffffff', '#fff', 'rgb(255,255,255)'];

View File

@ -36,7 +36,7 @@ function clipboardEventListener() {
window.$dialog?.success({
title: '操作成功',
content: '复制成功,请替换 src/settings/theme.json的内容',
positiveText: '确定',
positiveText: '确定'
});
});
}