context.app's type is a Vue instance
See original GitHub issueVersion
Reproduction link
https://nuxtjs.org/api/context
Steps to reproduce
Type of context.app is defined as Vue
[1] but it isn’t really a Vue instance. It’s just an object with root Vue instance options and also optionally other stuff injectected manually from plugins or through inject
function.
Documentation is also confused about it. It says type = Root Vue Instance
but in description it says The root Vue instance *options* that includes all your plugins.
(emphasis mine).
What is expected ?
context.app
doesn’t bare Vue
type but something custom.
What is actually happening?
context.app
type is Vue
.
Additional comments?
<div align="right">This bug report is available on Nuxt community (#c9159)</div>Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (5 by maintainers)
Top Results From Across the Web
context.app's type is a Vue instance · Issue #26 · nuxt/typescript
Type of context.app is defined as Vue [1] but it isn't really a Vue instance. It's just an object with root Vue instance...
Read more >The Vue Instance
A Vue application consists of a root Vue instance created with new Vue , optionally organized into a tree of nested, reusable components....
Read more >Creating a Vue Application - Vue.js
Every Vue application starts by creating a new application instance with the createApp function: js import { createApp } from 'vue' const app...
Read more >Adding Instance Properties - Vue.js
The Context of Prototype Methods In case you're not aware, methods added to a prototype in JavaScript gain the context of the instance....
Read more >Application API - Vue.js
Type. ts interface App { mount(rootContainer: Element | string): ComponentPublicInstance } · Details. The argument can either be an actual DOM element or...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Yes, it seems it is an ComponentOptions.
It’s:
Now how should the nuxt type be called? Something like
NuxtComponentOptions
would be most relevant but it doesn’t go along well with how this variable is called. 😃@rchl I created a PR to fix the type and this
context.app
confusion https://github.com/nuxt/nuxt.js/pull/5701 😉