Przeglądaj źródła

test(types): update TS version and fix types test (#7597)

Pig Fang 8 lat temu
rodzic
commit
2d168f1ba1
4 zmienionych plików z 8 dodań i 8 usunięć
  1. 3 3
      package-lock.json
  2. 1 1
      package.json
  3. 2 2
      types/test/plugin-test.ts
  4. 2 2
      types/test/vue-test.ts

+ 3 - 3
package-lock.json

@@ -9580,9 +9580,9 @@
       "dev": true
     },
     "typescript": {
-      "version": "2.6.2",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.6.2.tgz",
-      "integrity": "sha1-PFtv1/beCRQmkCfwPAlGdY92c6Q=",
+      "version": "2.7.1",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-2.7.1.tgz",
+      "integrity": "sha512-bqB1yS6o9TNA9ZC/MJxM0FZzPnZdtHj0xWK/IZ5khzVqdpGul/R/EIiHRgFXlwTD7PSIaYVnGKq1QgMCu2mnqw==",
       "dev": true
     },
     "uglify-js": {

+ 1 - 1
package.json

@@ -134,7 +134,7 @@
     "selenium-server": "^2.53.1",
     "serialize-javascript": "^1.3.0",
     "shelljs": "^0.7.8",
-    "typescript": "^2.6.1",
+    "typescript": "^2.7.1",
     "uglify-js": "^3.0.15",
     "webpack": "^3.10.0",
     "weex-js-runtime": "^0.23.5",

+ 2 - 2
types/test/plugin-test.ts

@@ -2,8 +2,8 @@ import Vue from "../index";
 import { PluginFunction, PluginObject } from "../index";
 
 class Option {
-  prefix: string;
-  suffix: string;
+  prefix: string = "";
+  suffix: string = "";
 }
 
 const plugin: PluginObject<Option> = {

+ 2 - 2
types/test/vue-test.ts

@@ -2,7 +2,7 @@ import Vue, { VNode } from "../index";
 import { ComponentOptions } from "../options";
 
 class Test extends Vue {
-  a: number;
+  a: number = 0;
 
   testProperties() {
     this.$data;
@@ -19,7 +19,7 @@ class Test extends Vue {
   }
 
   // test property reification
-  $refs: {
+  $refs!: {
     vue: Vue,
     element: HTMLInputElement,
     vues: Vue[],