es lint fix

This commit is contained in:
thofx
2023-07-22 16:09:07 +08:00
parent 48749b29fe
commit 018778488a
80 changed files with 3994 additions and 2981 deletions
+8 -5
View File
@@ -1,15 +1,18 @@
<script lang="ts" setup>
// 定义触发的自定义事件
const emit = defineEmits(["click"]);
const emit = defineEmits(['click'])
// 按钮点击
const onClick = () => {
emit("click");
};
function onClick() {
emit('click')
}
</script>
<template>
<IconBtn class="absolute right-3 top-3" @click="onClick">
<IconBtn
class="absolute right-3 top-3"
@click="onClick"
>
<VIcon icon="mdi-close" />
</IconBtn>
</template>
+12 -6
View File
@@ -1,20 +1,26 @@
<script setup lang="ts">
interface Props {
errorCode?: string;
errorTitle?: string;
errorDescription?: string;
errorCode?: string
errorTitle?: string
errorDescription?: string
}
const props = defineProps<Props>();
const props = defineProps<Props>()
</script>
<template>
<div class="text-center mb-4">
<!-- 👉 Title and subtitle -->
<h1 v-if="props.errorCode" class="text-h1 font-weight-medium">
<h1
v-if="props.errorCode"
class="text-h1 font-weight-medium"
>
{{ props.errorCode }}
</h1>
<h5 v-if="props.errorTitle" class="text-h5 font-weight-medium mb-3">
<h5
v-if="props.errorTitle"
class="text-h5 font-weight-medium mb-3"
>
{{ props.errorTitle }}
</h5>
<p v-if="props.errorDescription">
+3 -7
View File
@@ -1,12 +1,8 @@
<template>
<div class="absolute top-0 right-0 flex items-center justify-between p-2">
<div class="pointer-events-none z-40 flex items-center">
<div
class="relative inline-flex whitespace-nowrap rounded-full border-gray-700 font-semibold leading-5 ring-gray-700"
>
<div
class="rounded-full bg-opacity-80 shadow-md w-5 border p-0 bg-green-500 border-green-400 ring-green-400 text-green-100"
>
<div class="relative inline-flex whitespace-nowrap rounded-full border-gray-700 font-semibold leading-5 ring-gray-700">
<div class="rounded-full bg-opacity-80 shadow-md w-5 border p-0 bg-green-500 border-green-400 ring-green-400 text-green-100">
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
@@ -17,7 +13,7 @@
fill-rule="evenodd"
d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z"
clip-rule="evenodd"
></path>
/>
</svg>
</div>
</div>
+12 -5
View File
@@ -1,18 +1,25 @@
<script lang="ts" setup>
interface Props {
menuList?: unknown[];
itemProps?: boolean;
menuList?: unknown[]
itemProps?: boolean
}
const props = defineProps<Props>();
const props = defineProps<Props>()
</script>
<template>
<IconBtn>
<VIcon icon="mdi-dots-vertical" />
<VMenu v-if="props.menuList" activator="parent" close-on-content-click>
<VList :items="props.menuList" :item-props="props.itemProps" />
<VMenu
v-if="props.menuList"
activator="parent"
close-on-content-click
>
<VList
:items="props.menuList"
:item-props="props.itemProps"
/>
</VMenu>
</IconBtn>
</template>
+21 -21
View File
@@ -1,45 +1,45 @@
<script setup lang="ts">
import type { ThemeSwitcherTheme } from "@layouts/types";
import { ref, watch } from "vue";
import { useTheme } from "vuetify";
import { ref, watch } from 'vue'
import { useTheme } from 'vuetify'
import type { ThemeSwitcherTheme } from '@layouts/types'
const props = defineProps<{
themes: ThemeSwitcherTheme[];
}>();
themes: ThemeSwitcherTheme[]
}>()
const { name: themeName, global: globalTheme } = useTheme();
const { name: themeName, global: globalTheme } = useTheme()
const savedTheme = ref(localStorage.getItem("theme") ?? themeName);
const savedTheme = ref(localStorage.getItem('theme') ?? themeName)
const {
state: currentThemeName,
next: getNextThemeName,
index: currentThemeIndex,
} = useCycleList(
props.themes.map((t) => t.name),
{ initialValue: savedTheme.value }
);
props.themes.map(t => t.name),
{ initialValue: savedTheme.value },
)
const changeTheme = () => {
const nextTheme = getNextThemeName();
function changeTheme() {
const nextTheme = getNextThemeName()
globalTheme.name.value = nextTheme;
savedTheme.value = nextTheme;
localStorage.setItem("theme", nextTheme);
};
globalTheme.name.value = nextTheme
savedTheme.value = nextTheme
localStorage.setItem('theme', nextTheme)
}
// Update icon if theme is changed from other sources
watch(
() => globalTheme.name.value,
(val) => {
currentThemeName.value = val;
}
);
currentThemeName.value = val
},
)
// Apply saved theme on page load
onMounted(() => {
globalTheme.name.value = savedTheme.value;
});
globalTheme.name.value = savedTheme.value
})
</script>
<template>