With Nuxt 2 I could do
<script lang="ts">
import Vue from 'vue'
export default class Login extends Vue {
mounted() {
if (!this.$auth.loggedIn) {
this.$auth.login()
}
}
}
</script>
How do I change this to Nuxt 2 Bridge Composition API?
<script setup lang="ts">
onMounted(() => {
// ?
})
</script>
useNuxtApp()gives access to the context:However, at the moment typing with Nuxt 2 Bridge only works on the
nuxt2Contextproperty: