perf: faster app without defineAsync
This commit is contained in:
@@ -1,9 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { useAlertStore } from "@/stores/alerts";
|
||||
import { defineAsyncComponent } from "vue";
|
||||
const AlertItem = defineAsyncComponent(
|
||||
() => import("@/components/AlertItem.vue"),
|
||||
);
|
||||
import AlertItem from "@/components/AlertItem.vue";
|
||||
|
||||
const { alerts } = useAlertStore();
|
||||
</script>
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onBeforeMount, watch, defineAsyncComponent } from "vue";
|
||||
import { ref, onBeforeMount, watch } from "vue";
|
||||
import { getCron, parseCron, validCron } from "@/lib/recurrence";
|
||||
import { CronType } from "@/enums";
|
||||
const DateInput = defineAsyncComponent(
|
||||
() => import("@/components/DateInput.vue"),
|
||||
);
|
||||
import DateInput from "@/components/DateInput.vue";
|
||||
|
||||
const DEFAULT_CRON = "0 0 * * *";
|
||||
|
||||
|
||||
@@ -1,20 +1,16 @@
|
||||
<script setup lang="ts">
|
||||
import { getMetadata } from "@/api/meta";
|
||||
import type { Metadata } from "@/types";
|
||||
import { defineAsyncComponent, onBeforeMount, ref } from "vue";
|
||||
import { onBeforeMount, ref } from "vue";
|
||||
import LangInput from "@/components/LangInput.vue";
|
||||
|
||||
const metadata = ref<Metadata|null>(null);
|
||||
|
||||
const LangInput = defineAsyncComponent(
|
||||
() => import("@/components/LangInput.vue"),
|
||||
);
|
||||
const metadata = ref<Metadata | null>(null);
|
||||
|
||||
function fetchMetadata() {
|
||||
void getMetadata()
|
||||
.then((data) => {
|
||||
metadata.value = data;
|
||||
setTimeout(fetchMetadata, 600000);
|
||||
});
|
||||
void getMetadata().then((data) => {
|
||||
metadata.value = data;
|
||||
setTimeout(fetchMetadata, 600000);
|
||||
});
|
||||
}
|
||||
|
||||
onBeforeMount(fetchMetadata);
|
||||
|
||||
@@ -4,15 +4,12 @@ import {
|
||||
ref,
|
||||
watch,
|
||||
computed,
|
||||
defineAsyncComponent,
|
||||
nextTick,
|
||||
} from "vue";
|
||||
import type { Task } from "@/types";
|
||||
import { CopyIcon, TrashIcon, SaveIcon, XIcon } from "@lucide/vue";
|
||||
import { updateTask } from "@/api/tasks";
|
||||
const CronInput = defineAsyncComponent(
|
||||
() => import("@/components/CronInput.vue"),
|
||||
);
|
||||
import CronInput from "@/components/CronInput.vue";
|
||||
import {
|
||||
isTemporary,
|
||||
taskCompleted,
|
||||
|
||||
Reference in New Issue
Block a user