「*.vue」ファイルを使用すると、TypeScript インターフェースが期待どおりに機能しません。提供された型が悪い場合、「警告」はスローされません。フォーム 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": "*"
},