From caa196e772a090204d5c69aff4db76645a604d30 Mon Sep 17 00:00:00 2001 From: toxichl <472590061@qq.com> Date: Thu, 16 Feb 2017 23:14:05 +0800 Subject: [PATCH] Modify the vue-router type declaration file and enable it to support TypeScript 2.0 --- types/router.d.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/types/router.d.ts b/types/router.d.ts index 60ad25e2c..c7b1e1079 100644 --- a/types/router.d.ts +++ b/types/router.d.ts @@ -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 | typeof Vue; type Dictionary = { [key: string]: T };