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

Does not work with non-class decorator Vue #26

Open
renestalder opened this issue Jun 27, 2019 · 1 comment
Open

Does not work with non-class decorator Vue #26

renestalder opened this issue Jun 27, 2019 · 1 comment

Comments

@renestalder
Copy link

As opposed to #19, it does not work with non-class decorator components.

The fixture is not using the correct way of one should write components with TypeScript, thus the tests will probably be successful.

Current fixture:

<template>
  <div>{{ foo }}</div>
</template>

<script lang="ts">
export default {
  data () {
    return {
      foo: 'Hello'
    }
  }
}
</script>

<style>
div {
  color: red;
}
</style>

The correct fixture would be:

<template>
  <div>{{ foo }}</div>
</template>

<script lang="ts">
import Vue from 'vue';
export default Vue.extend({
  data () {
    return {
      foo: 'Hello'
    }
  }
});
</script>

<style>
div {
  color: red;
}
</style>

With this, vuetype throws an error:

Default export of the module has or is using private name 'VueConstructor'.
@trusktr
Copy link

trusktr commented Dec 21, 2019

Regarding the all-too-common "has or is using private name" error, I've opened a request to fix issues like these in TypeScript by bringing declaration files to parity with language features. microsoft/TypeScript#35822

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

No branches or pull requests

2 participants