blob: 49d61c14e64391d2c2534b2fcf08e972949a873e [file] [log] [blame]
Derick Montaguee080a1a2019-12-04 16:30:08 -06001<template>
2 <div>
Derick Montague75b48322019-12-06 01:24:41 -06003 <AppHeader ref="focusTarget" />
Derick Montaguee080a1a2019-12-04 16:30:08 -06004 <b-container fluid class="page-container">
5 <b-row no-gutters>
6 <b-col tag="nav" cols="12" md="3" lg="2">
7 <AppNavigation />
8 </b-col>
9 <b-col cols="12" md="9" lg="10">
Yoshie Muranaka8d129102019-12-19 09:51:55 -080010 <PageContainer>
Derick Montague75b48322019-12-06 01:24:41 -060011 <router-view ref="routerView" />
Yoshie Muranaka8d129102019-12-19 09:51:55 -080012 </PageContainer>
Derick Montaguee080a1a2019-12-04 16:30:08 -060013 </b-col>
14 </b-row>
15 </b-container>
16 </div>
17</template>
18
19<script>
20import AppHeader from "@/components/AppHeader";
21import AppNavigation from "@/components/AppNavigation";
Yoshie Muranaka8d129102019-12-19 09:51:55 -080022import PageContainer from "../components/Global/PageContainer";
Derick Montaguee080a1a2019-12-04 16:30:08 -060023export default {
24 name: "App",
25 components: {
26 AppHeader,
Yoshie Muranaka8d129102019-12-19 09:51:55 -080027 AppNavigation,
28 PageContainer
Derick Montague75b48322019-12-06 01:24:41 -060029 },
30 watch: {
31 $route: function() {
32 // $nextTick = DOM updated
33 this.$nextTick(function() {
34 // Get the focusTarget DOM element
35 let focusTarget = this.$refs.focusTarget.$el;
36
37 // Make focustarget programmatically focussable
38 focusTarget.setAttribute("tabindex", "-1");
39
40 // Focus element
41 focusTarget.focus();
42
43 // Remove tabindex from focustarget
44 // Reason: https://axesslab.com/skip-links/#update-3-a-comment-from-gov-uk
45 focusTarget.removeAttribute("tabindex");
46 });
47 }
Derick Montaguee080a1a2019-12-04 16:30:08 -060048 }
49};
50</script>
51
52<style lang="scss" scoped>
53.page-container {
54 margin-right: 0;
55 margin-left: 0;
56 padding-right: 0;
57 padding-left: 0;
58}
59</style>