You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IntelliSense for the context object of the new composition API is not working correctly.
The following SFC works perfectly fine and redirects the user upon authentication to the home page:
<template><q-pagepadding><h3>Login</h3><h5>Hi there stranger. Would you mind telling us who you are?</h5><p>Click on the login button on the to right corner</p></q-page></template><scriptlang="ts">import{ defineComponent, onBeforeMount }from'@vue/composition-api'import{useAccount}from'../../src/comp-functions/useAccount'exportdefaultdefineComponent({setup(props,context){const{ isAuthenticated }=useAccount()onBeforeMount(()=>{if(isAuthenticated.value){context.root.$router.push('/')}})},})</script>
TypeScript is not reporting any error but Vetur is showing a red squiggly line under the word $router and IntelliSense can't complete it. Although the code works fine:
The functionality is fine, everything works as expected. However, when having multiple projects open at the same time in vs code than Vetur fails to resolve the context.root.$router and shows a squiggly line. When working in vscode with only this project open it works fine and Vetur doesn't report an issue.
Info
Problem
IntelliSense for the
context
object of the newcomposition API
is not working correctly.The following SFC works perfectly fine and redirects the user upon authentication to the home page:
TypeScript is not reporting any error but Vetur is showing a red squiggly line under the word
$router
and IntelliSense can't complete it. Although the code works fine:Also no error in the
Vue Language Server
:Reproducible Case
Full source code can be found here.
The text was updated successfully, but these errors were encountered: