Environment
vue
Reproduction link
https://run.iviewui.com/abNQ16wG
Steps to reproduce
Message.info('title')
What is expected?
直接调用 Message 上的方法时 ts 不会产生错误
static error(config?: MessageConfig | string): void;
What is actually happening?
直接使用 message 时, ts 会提示 -> 类型“typeof Message”上不存在属性“error”。
3条答案
按热度按时间92dk7w1h1#
Translation of this issue:
Environment
Vue
Reproduction link
https://run.iviewui.com/abNQ16wG
Steps to reproduce
Message. info ('title')
What is expected?
TS does not produce errors when calling methods directly on Message
Static error (config?: MessageConfig | string): void;
What is actually happening?
When using message directly, TS will prompt - > that there is no attribute "error" on the type "typeof Message".
bn31dyow2#
同样的问题。
m528fe3b3#
同样问题,兼容的办法,Message 做类型断言