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

Modify the vue-router type declaration file and enable it to support TypeScript 2.0 complier #1171

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion types/router.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import Vue = require("vue");
import { ComponentOptions, PluginFunction } from "vue";
/**
* source code: import { ComponentOptions, PluginFunction } from "vue";
*
* This source code in the TypeScript2.0 environment will be error:
* " ... node_modules / vue-router / types / vue " has no exported member 'ComponentOptions'.
* " ... node_modules / vue-router / types / vue " has no exported member 'PluginFunction'.
*
* Since I have installed Vue2.0, so I directly quoted the vuejs type file.
* The most reasonable thing is to remove the coupling and make it run properly.
*/
import { ComponentOptions } from "../../vue/types/options";
import { PluginFunction } from "../../vue/types/plugin";

type Component = ComponentOptions<Vue> | typeof Vue;
type Dictionary<T> = { [key: string]: T };
Expand Down