-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Add AsyncComponent type to RouteOptions.component #1619
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
Conversation
AsyncComponent is currently allowed, but typescript is giving me a bogus error. This type definition update fixes this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ktsn Is it worth to add a test for this?
@posva Yeah, a test would be helpful. |
hey @kaleb could you add a test for this, please? |
Sure thing.
…On Tue, Aug 22, 2017, 06:30 Eduardo San Martin Morote < ***@***.***> wrote:
hey @kaleb <https://github.com/kaleb> could you add a test for this,
please?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1619 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAekZP1lHDbH7zTS3Puxd_KSrsVHwzl4ks5saq3YgaJpZM4Oc7hS>
.
|
I tried to add this code manually but TypeScript still throws error when using new VueRouter({
routes: [
{
path: '/',
component: () => import('../views/Home.vue')
}
]
}) @kaleb Have you used dynamic import for AsyncComponent successfully before? |
@JounQin Yes... sorry, it has taken me a bit to get back to this. Just a minute, and I can look it up where I use it. |
@JounQin You need to be using webpack for that specific syntax... I myself use SystemJS. |
@posva Added test |
halp @ktsn 🙏 |
@kaleb Of course I'm using dynamic import with webpack. https://github.com/JounQin/ts-study/blob/dynamic_import/src/router/index.ts So maybe type of AsyncComponent or AsyncComponent as RouterComponent should be updated. |
Oh, I see. I think we should update AsyncComponent type in core because resolving |
The PR was already made. vuejs/vue#6477 |
AsyncComponent is currently allowed, but typescript is giving me a bogus error. This type definition update fixes this.