From db0367ed7117a985136c9b0b817ccccbe170cda9 Mon Sep 17 00:00:00 2001 From: afeiship <1290657123@qq.com> Date: Sun, 1 Sep 2024 21:35:21 +0800 Subject: [PATCH] docs: upt gets --- README.md | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2e10bf2..e1bf55b 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,35 @@ const configs = [ const query = new ConfigQuery(configs); -// filter by language +// gets +const yes_no_items = query.gets({ key: "yes_or_no" }); +console.log(yes_no_items); + + +/** output: + * [ + * { + * "school_level": null, + * "language": "zh-CN", + * "key": "yes_or_no", + * "value": [ + * { "label": "是", "value": "yes" }, + * { "label": "否", "value": "no" } + * ] + * }, + * { + * "school_level": null, + * "language": "en-US", + * "key": "yes_or_no", + * "value": [ + * { "label": "Yes", "value": "yes" }, + * { "label": "No", "value": "no" } + * ] + * } + * ] + */ + +// get by language const en = query.get({ language: "en-US" }); console.log(en); @@ -55,7 +83,7 @@ console.log(en); */ // value filter -const yes = query.get({ key: "yes_or_no", "language": "zh-CN" }); +const yes = query.value({ key: "yes_or_no", "language": "zh-CN" }); console.log(yes);