တိကျသော အစိတ်အပိုင်းသတ်မှတ်ချက်ကို ရှာပါ
အစိတ်အပိုင်း ရှာပါ။ ၎င်း၏ API အတိအကျကို ဖတ်ပါ။
အများသုံးစာရင်း၊ စနစ်တကျ API အညွှန်း၊ ခွဲထားသော ကိုးကားချက်နှင့် MCP ရှာဖွေမှုတို့က ဂုဏ်သတ္တိ၊ ဖြစ်ရပ်၊ slot၊ မှီခိုမှုနှင့် ရွှေ့ပြောင်းရေးလမ်းညွှန်ကို ဖော်ပြသည်။ ထို့ကြောင့် ကုဒ်ရေးအေးဂျင့်သည် markup မရေးမီ တိကျသော သတ်မှတ်ချက်ကို စစ်နိုင်သည်။
နမူနာ
အစိတ်အပိုင်းတစ်ခုကို ရှာပြီး ၎င်း၏ တိကျသော API ကို ဖတ်ပါ။
const origin = 'https://www.lyra-ui.com/api/v1/components';
const search = await fetch(origin + '/search?q=combobox');
if (!search.ok) throw new Error('Component search failed');
const { matches } = await search.json();
const tag = matches[0]?.tag;
if (tag) {
const response = await fetch(origin + '/' + encodeURIComponent(tag));
if (!response.ok) throw new Error('Component reference failed');
const reference = await response.json();
console.log(reference.markdown);
}အစိတ်အပိုင်းများ ကြည့်ပါ · လမ်းညွှန်ကို ဖတ်ရန် (အင်္ဂလိပ်ဘာသာ)