Skip to content

awebc/zidian

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zidian 字典

汉字、词语、成语查询接口

引言

使用

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/zidian.js"></script>

查看 https://unpkg.com/zidian/
拉取 npm install zidian

汉字查询

zidian.equalWord (key)
zidian.equalWord ("爱").then (console.log)

词语查询

zidian.equalCi (key)
zidian.equalCi ("美丽").then (console.log)

成语查询

zidian.equalIdiom (key)
zidian.equalIdiom ("叶公好龙").then (console.log)

词语模糊搜索

zidian.likeCi (key)
zidian.likeCi ("美").then (console.log)

成语模糊搜索

zidian.likeIdiom (key)
zidian.likeIdiom ("三百").then (console.log)

说明

  • 接口查询返回一个 Promise 对象
  • 查询的接口会缓存到 zidian.cache 对象
  • 查询无记录时,返回 null
  • zidian.config.host 可配置请求源

About

汉字、词语、成语查询接口

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 100.0%