vue3 中使用 element-ui 时出现的 Property ‘$notify‘ does not exist on type ‘App‘.
欢迎使用Markdown编辑器上手研究了下 vue + typescript 开发 发现使用 element-ui之后 element库里的一些对vue的扩展方法无法使用比如调用 this.$notify 方法显示通知会报以下错误百度找了半天 找到几种方案强转 any (<any>this).$notifyas (this as any).$notify在类中增加声明 private $notify: any;这几种办法异曲同工,但是我用的是typ
原创
2020-11-08 13:42:08 ·
3539 阅读 ·
3 评论