question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support analyzing vue-class-component

See original GitHub issue

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)
  }
}

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:55
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

31reactions
dennis2kcommented, Feb 26, 2019

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

6reactions
octrefcommented, 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 https://github.com/vuejs/rfcs/pull/17. Supporting them all is likely a lot of maintenance.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found