package.jsonは以下の通り
"devDependencies": {
"@types/dateformat": "^3.0.0",
"@vue/cli-plugin-typescript": "^3.9.0",
"@vue/cli-service": "^3.9.2",
"node-sass": "^4.12.0",
"sass-loader": "^7.1.0",
"stats-webpack-plugin": "^0.7.0",
"typescript": "^3.5.3",
"vue": "^2.6.10",
"vue-template-compiler": "^2.6.10",
"webpack-bundle-analyzer": "^3.3.2"
}
解決策は、functionに戻り値の型を書く。anyでも良い。
before
computed: {
listUlClass: function (){
return "";
},
listLIClass: function () {
return {};
},
}
after
computed: {
listUlClass: function ():string{
return "";
},
listLIClass: function () :any{
return {};
},
}
アロー関数式でない普通のfunctionで戻り値の型を書く発想が無かった・・・。vue3では全部アローで書けるといいな