[Vue warn]: Unhandled error during execution of native event handler
在@click中调用了异步函数
Good Code
const handleClick = async () => {
await asyncFunction(param: YourParam).then(() => {
//...
}).catch(() => { }).finally(() => {
//...
})
}
Talk
个人菜鸟理解大概是vue或者ts警告异步函数没有规范处理抛出的异常,所以需要加上 .catch(() => {})
以‘假’处理的方法来取消警告