问题
在catch中统一处理异常信息,就想着写到一个函数里面,然后需要用到的地方自行调用就可以。
一般两种方法,要不通过mixin,要不绑定到vue的prototype上面。
这里采用的是后者。
在以前没引入ts之前,是那么简单的一件事情。
// 先绑定
Vue.prototype.$catchRequestError = function () {}
// 再引用
this.$catchRequestError()
可是IDE缺给出错误提示了。
错误提示是:Property '$catchRequestError' does not exist on type 'InstanceList'.
解决
看起来说是$catchRequestError不存在InstanceList的type上面。
详情: https://mp.weixin.qq.com/s?__biz=Mzg5Mjc2NDYwMg==&mid=2247484...
有问题可群咨询:
https://public-1253796280.cos.ap-nanjing.myqcloud.com/%E5%89%...
- Property exist 39 does typeproperty exist 39 does property includes exist does 39 property java type transactionlistener rocketmqtemplate exist does property error route exist 39 vitemockoptions localenabled exist sqlsessiontemplate sqlsessionfactory 39 property 39 xmlhttprequest responsetext property reflectionexception 39 property submenu vscode问题exist does