baidu / amis

前端低代码框架,通过 JSON 配置就能生成各种页面。
https://baidu.github.io/amis/
Apache License 2.0
17.33k stars 2.51k forks source link

咨询扩展表单验证怎么写 #10160

Closed xiahao90 closed 5 months ago

xiahao90 commented 6 months ago

实现场景:

我需要写扩展表单验证,我用的sdk。看文档里面是

let amisLib = amisRequire('amis');
amisLib.addRule(

我用sdk加载的时候是:

 let amis = amisRequire('amis/embed');

我的代码就写成了:

  let amis = amisRequire('amis/embed');
      amis.addRule(

存在的问题:

就报错了(索引):98 Uncaught TypeError: amis.addRule is not a function

当前方案:

code here...
2betop commented 6 months ago

https://aisuda.bce.baidu.com/amis/zh-CN/docs/extend/addon#%E6%99%AE%E9%80%9A%E7%94%A8%E6%B3%95

2betop commented 6 months ago

按文档的方式来

2betop commented 6 months ago

不对,可以出现很多次