Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 1 | <template> |
| 2 | <div> |
Derick Montague | 75b4832 | 2019-12-06 01:24:41 -0600 | [diff] [blame] | 3 | <AppHeader ref="focusTarget" /> |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 4 | <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 Muranaka | 8d12910 | 2019-12-19 09:51:55 -0800 | [diff] [blame^] | 10 | <PageContainer> |
Derick Montague | 75b4832 | 2019-12-06 01:24:41 -0600 | [diff] [blame] | 11 | <router-view ref="routerView" /> |
Yoshie Muranaka | 8d12910 | 2019-12-19 09:51:55 -0800 | [diff] [blame^] | 12 | </PageContainer> |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 13 | </b-col> |
| 14 | </b-row> |
| 15 | </b-container> |
| 16 | </div> |
| 17 | </template> |
| 18 | |
| 19 | <script> |
| 20 | import AppHeader from "@/components/AppHeader"; |
| 21 | import AppNavigation from "@/components/AppNavigation"; |
Yoshie Muranaka | 8d12910 | 2019-12-19 09:51:55 -0800 | [diff] [blame^] | 22 | import PageContainer from "../components/Global/PageContainer"; |
Derick Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 23 | export default { |
| 24 | name: "App", |
| 25 | components: { |
| 26 | AppHeader, |
Yoshie Muranaka | 8d12910 | 2019-12-19 09:51:55 -0800 | [diff] [blame^] | 27 | AppNavigation, |
| 28 | PageContainer |
Derick Montague | 75b4832 | 2019-12-06 01:24:41 -0600 | [diff] [blame] | 29 | }, |
| 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 Montague | e080a1a | 2019-12-04 16:30:08 -0600 | [diff] [blame] | 48 | } |
| 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> |