Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support analyzing vue-class-component #1105

Closed
octref opened this issue Feb 19, 2019 · 6 comments · Fixed by #1323
Closed

Support analyzing vue-class-component #1105

octref opened this issue Feb 19, 2019 · 6 comments · Fixed by #1323

Comments

@octref
Copy link
Member

octref commented Feb 19, 2019

Continuing #1083

ComponentInfo is not able to analyze vue-class-component yet.

The source looks like below, so it needs a different AST visitor. Maybe we can use typing from vue-class-component to analyze it.

@Component({
  props: {
    propMessage: String
  }
})
export default class App extends Vue {
  // initial data
  msg = 123

  // use prop values for initial data
  helloMsg = 'Hello, ' + this.propMessage

  // lifecycle hook
  mounted () {
    this.greet()
  }

  // computed
  get computedMsg () {
    return 'computed ' + this.msg
  }

  // method
  greet () {
    alert('greeting: ' + this.msg)
  }
}
@dennis2k
Copy link

It is also important to note that vue-class-component is often used along with the vue-property-decorator for defining props

@trekze
Copy link

trekze commented Apr 2, 2019

Is this going to be a tough one or are we likely to see it in a near-future release?

@octref
Copy link
Member Author

octref commented Apr 2, 2019

I'd like to limit this issue to only vue-class-component, which is officially supported.

There are many decorator libraries such as https://github.com/kaorun343/vue-property-decorator, https://github.com/itsFrank/vue-typescript, and one in the upcoming Vue 3 vuejs/rfcs#17. Supporting them all is likely a lot of maintenance.

@trekze
Copy link

trekze commented Apr 24, 2019

I'd like to limit this issue to only vue-class-component, which is officially supported.

There are many decorator libraries such as https://github.com/kaorun343/vue-property-decorator, https://github.com/itsFrank/vue-typescript, and one in the upcoming Vue 3 vuejs/rfcs#17. Supporting them all is likely a lot of maintenance.

I think that's a reasonable compromise.

@wizardnet972
Copy link

wizardnet972 commented Sep 12, 2019

@octref @dennis2k
Any news? or workaround? Its a critical bug for me. I can't use vetur with vscode due to this bug.

Here the bug:
vuejs/vue-class-component#360

@yoyo930021
Copy link
Member

Hi anyone, I publish self-maintenance vscode extension.
This extension will be maintained until Vetur is reactivated.

https://marketplace.visualstudio.com/items?itemName=yoyo930021.vuter

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants