nuxt: Computed Property this IntelliSense broken

Version

v2.6.0

Reproduction link

https://github.com/stefnotch/temp-nuxt-starter-app

Steps to reproduce

  1. Create a new Nuxt project
  2. Optionally upgrade nuxt to version v2.6.1
  3. Type the following in a component
computed: {
    test() {
      return "" + this. // HERE!!
    }
}

Alternatively, clone the repo and take a look at index.vue

What is expected ?

Various IntelliSense suggestions such as this.$data, this.$emit, this.$nuxt should show up

What is actually happening?

None of them show up

Untitled.png

This doesn’t work either:

    test2: function( ) {
      return "" + this. // HERE!!
    }

Additional comments?

In methods: { someMethod() {} }, the IntelliSense for this works as expected.

I also have issues with this.$router not showing up in the methods: {}, but that’s a different issue.

<div align="right">This bug report is available on Nuxt community (#c9039)</div>

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 18 (4 by maintainers)

Most upvoted comments

It appears that this issue does not exist anymore. As such, I can close it.

I think Vetur is providing Auto completion / IntelliSense without readading Vue typings, it’s probably bound to the extension core. So i’m afraid you’ll not be able to have everything working with Nuxt.

EDIT : Unless you want tro give a try to TypeScript, you’ll also be able to have type checking this way.