使用test为string的时候就报错,换成any就没报错,这个是什么问题呢

来源:5-10 ValidateForm 编码第三部分 - 寻找外援 mitt

weixin_慕丝8449801

2020-10-12

图片描述

写回答

5回答

张轩

2020-10-12

同学你好 请看常见问题欧 

https://coding.imooc.com/learn/questiondetail/206736.html

还有我们的勘误文档,https://shimo.im/docs/YT9cdpDcKKCWV3CX/ 《常见问题和代码升级事项》里面都有记录 

1
0

qq_慕前端0178666

2020-10-12

我也有同样的问题 ̄□ ̄||

1
1
qq_我在时光机里找回忆
我也有,我读了一下英文的报错提示,说是没有符合这个要求的重载,还说我的哪个参数在哪种情况不符合要求
2020-11-15
共1条回复

同步MU

2020-11-10

//img.mukewang.com/szimg/5faa9d1d0955eeb507040184.jpg


    // 将监听得到的验证函数都存到一个数组中

    const callback = (func: ValidateFunc) => {

      funcArr.push(func)

    }


这个错误该怎么解决呢》

0
0

weixin_慕神3292065

2020-10-12

将test参数设置成可选参数就行了 test?:string

0
4
同步MU
回复
晨曦的希望
runtime-core.esm-bundler.js?5c40:217 Uncaught TypeError: props.rules.every is not a function at validateInput (ValidateInput.vue?54b9:35) at eval (ValidateForm.vue?f1a4:17) at Array.map () at Proxy.submitForm (ValidateForm.vue?f1a4:17) at eval (ValidateForm.vue?b0f8:4) at eval (runtime-dom.esm-bundler.js?830f:1097) at callWithErrorHandling (runtime-core.esm-bundler.js?5c40:154) at callWithAsyncErrorHandling (runtime-core.esm-bundler.js?5c40:163) at HTMLDivElement.invoker (runtime-dom.esm-bundler.js?830f:292) // 将监听得到的验证函数都存到一个数组中 const callback = (func?: ValidateFunc) => { if(func){ funcArr.push(func) } } 那加判断后,报这个错怎么解决呢
2020-11-10
共4条回复

晨曦的希望

2020-10-12

https://coding.imooc.com/learn/questiondetail/206736.html

0
0

Vue3 + TS 仿知乎专栏企业级项目

带你完成前后端分离复杂项目,率先掌握 vue3 造轮子技能

3067 学习 · 2247 问题

查看课程