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

TypeScript support #7

Open
2 tasks
cexbrayat opened this issue Jan 29, 2020 · 3 comments
Open
2 tasks

TypeScript support #7

cexbrayat opened this issue Jan 29, 2020 · 3 comments

Comments

@cexbrayat
Copy link
Member

cexbrayat commented Jan 29, 2020

Thank you for making this plugin.

It is currently usable with the TypeScript CLI plugin, but requires a few changes in the generated project:

npx @vue/cli create vtc-repro --inlinePreset '{"plugins": {"@vue/cli-plugin-typescript": {"classComponent": false},"vue-cli-plugin-vue-next": {}}}'

The changes needed are in this commit.

Here is a list:

  • change the App component to use defineComponent
  • remove the shim files

Is it something that the plugin could handle? Or do you have in mind to create another plugin for the TS version?

@ishitatsuyuki
Copy link

Shims are required for routers. A working version can be copied from https://github.com/vuejs/vue-router-next/blob/master/playground/shim.d.ts

@cexbrayat
Copy link
Member Author

@ishitatsuyuki I'm not sure you need the shims. I have a project with Vue 3.0.0-alpha.12, Vue Router 4.0.0-alpha.5, using TypeScript and the Vue CLI, and I don't need them.

@ishitatsuyuki
Copy link

Okay, “required” might have been vague here. The shims are needed for code assistance, otherwise Visual Studio Code will give red lines for component imports.

webpack build will complete without them.

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