Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
本地模式
option为字符串:
option 为数组:(value键为必须,data可省略)
设定group有更简便的方式,使用方式和select类似:
以上两种方法都支持闭包,闭包需要返回以上对应的array格式:
远程API模式
远程API 服务端的请求参数为query,示例代码如下:
自定义 autocomplete 的设置:
详细设置请参考: devbridge/jQuery-Autocomplete
configs 同样也支持闭包:
联动:
autocomplete 的联动逻辑和select的刚好相反。
depends 需要写在受影响的字段,不限上级字段类型,上级字段的值将同时上传到API。