fix: #216. setHighlightedNavItemOnLanding
This commit is contained in:
@@ -11,6 +11,8 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { onBeforeMount, } from 'vue';
|
||||
import { useRouter } from 'vue-router';
|
||||
import { storeToRefs, mapActions, mapState, } from 'pinia';
|
||||
import LoadingStore from '@/stores/loading.js';
|
||||
import AllMapDataStore from '@/stores/allMapData.js';
|
||||
@@ -30,9 +32,26 @@ export default {
|
||||
const loadingStore = LoadingStore();
|
||||
const allMapDataStore = AllMapDataStore();
|
||||
const conformanceStore = ConformanceStore();
|
||||
const pageAdminStore = PageAdminStore();
|
||||
const { tempFilterId, createFilterId, temporaryData, postRuleData, ruleData } = storeToRefs(allMapDataStore);
|
||||
const { conformanceLogTempCheckId, conformanceFilterTempCheckId } = storeToRefs(conformanceStore);
|
||||
const router = useRouter();
|
||||
|
||||
const setHighlightedNavItemOnLanding = () => {
|
||||
const currentPath = router.currentRoute.value.path;
|
||||
const pathSegments = currentPath.split('/').filter(segment => segment !== '');
|
||||
if(pathSegments.length === 1) {
|
||||
if(pathSegments[0] === 'files') {
|
||||
pageAdminStore.setActivePage('ALL');
|
||||
}
|
||||
} else if (pathSegments.length > 1){
|
||||
pageAdminStore.setActivePage(pathSegments[1].toUpperCase());
|
||||
}
|
||||
};
|
||||
|
||||
onBeforeMount(() => {
|
||||
setHighlightedNavItemOnLanding();
|
||||
});
|
||||
return {
|
||||
loadingStore, temporaryData, tempFilterId,
|
||||
createFilterId, postRuleData, ruleData,
|
||||
|
||||
Reference in New Issue
Block a user