0

TypeScript 界面无法按预期使用“*.vue”文件。当提供的类型不好时,它不会抛出任何“警告”。示例表单 vue.js 文件:

<script lang="ts">

interface Test {
   w: string;
   h: number;
}

// This part of code doesn't work. 
// It doesn't show any message about 
// type incompatibility 
//(propert h must have "number" type).

let myVar: Test = {
    w: "10",
    h: "26",
};

//At the same time this code works correctly in '.ts' files.

</script>

如何解决?

我的 devDependencies 信息:

"devDependencies": {
    "@types/velocity-animate": "^1.2.30",
    "@types/vue-resource": "^0.9.31",
    "babel-plugin-transform-object-rest-spread": "*",
    "cross-env": "^3.2.3",
    "laravel-mix": "0.*",
    "normalize.css": "*",
    "pug": "*",
    "ts-loader": "^2.2.0",
    "typescript": "^2.3.4",
    "vue": "*",
    "vue-resource": "*",
    "vue-router": "*"
  },
4

0 回答 0