Use defineOptions for beforeRouteEnter, eliminating dual script block (S3863)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
<StatusBar></StatusBar>
|
<StatusBar></StatusBar>
|
||||||
</main>
|
</main>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script setup>
|
||||||
// The Lucia project.
|
// The Lucia project.
|
||||||
// Copyright 2023-2026 DSP, inc. All rights reserved.
|
// Copyright 2023-2026 DSP, inc. All rights reserved.
|
||||||
// Authors:
|
// Authors:
|
||||||
@@ -19,13 +19,20 @@
|
|||||||
* with sidebar rule configuration and results display.
|
* with sidebar rule configuration and results display.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { useConformanceStore as useConformanceStoreInGuard } from "@/stores/conformance";
|
import { onMounted, onBeforeUnmount } from "vue";
|
||||||
|
import { useRoute } from "vue-router";
|
||||||
|
import { storeToRefs } from "pinia";
|
||||||
|
import { useLoadingStore } from "@/stores/loading";
|
||||||
|
import { useConformanceStore } from "@/stores/conformance";
|
||||||
|
import StatusBar from "@/components/Discover/StatusBar.vue";
|
||||||
|
import ConformanceResults from "@/components/Discover/Conformance/ConformanceResults.vue";
|
||||||
|
import ConformanceSidebar from "@/components/Discover/Conformance/ConformanceSidebar.vue";
|
||||||
|
|
||||||
export default {
|
defineOptions({
|
||||||
async beforeRouteEnter(to, from, next) {
|
async beforeRouteEnter(to, from, next) {
|
||||||
const isCheckPage = to.name.includes("Check");
|
const isCheckPage = to.name.includes("Check");
|
||||||
if (isCheckPage) {
|
if (isCheckPage) {
|
||||||
const conformanceStore = useConformanceStoreInGuard();
|
const conformanceStore = useConformanceStore();
|
||||||
switch (to.params.type) {
|
switch (to.params.type) {
|
||||||
case "log":
|
case "log":
|
||||||
conformanceStore.setConformanceLogCreateCheckId(to.params.fileId);
|
conformanceStore.setConformanceLogCreateCheckId(to.params.fileId);
|
||||||
@@ -39,17 +46,7 @@ export default {
|
|||||||
}
|
}
|
||||||
next();
|
next();
|
||||||
},
|
},
|
||||||
};
|
});
|
||||||
</script>
|
|
||||||
<script setup>
|
|
||||||
import { onMounted, onBeforeUnmount } from "vue";
|
|
||||||
import { useRoute } from "vue-router";
|
|
||||||
import { storeToRefs } from "pinia";
|
|
||||||
import { useLoadingStore } from "@/stores/loading";
|
|
||||||
import { useConformanceStore } from "@/stores/conformance";
|
|
||||||
import StatusBar from "@/components/Discover/StatusBar.vue";
|
|
||||||
import ConformanceResults from "@/components/Discover/Conformance/ConformanceResults.vue";
|
|
||||||
import ConformanceSidebar from "@/components/Discover/Conformance/ConformanceSidebar.vue";
|
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user