Fix $nuxt undefined

This commit is contained in:
Sam Carlton 2022-04-29 13:58:27 -05:00
parent ad913ae51d
commit bd17f443e5

View file

@ -162,6 +162,9 @@
</template> </template>
<script> <script>
// https://anguscroll.com/just/just-has
import has from 'just-has'
import LinkButton from '~/components/link-button.vue' import LinkButton from '~/components/link-button.vue'
export default { export default {
@ -206,7 +209,7 @@ export default {
computed: { computed: {
currentPath () { currentPath () {
// If we have a nuxt context, use that. // If we have a nuxt context, use that.
if (this.$nuxt) { if ( has( this, [ '$nuxt' ]) ) {
return this.$nuxt.$route.path return this.$nuxt.$route.path
} }