Take this one as example…
import wixData from 'wix-data';
$w.onReady(function () {
$w("#myRepeater").onItemReady(($item, itemData, index) => {
$item("#myText").text = itemData.text;
$item("#myImage").src = itemData.image;
// Link to the dynamic item page
$item("#myButton").link = itemData.url;
});
});
export function searchButton_click(event) {
let searchResult = $w('#searchInput').value;
wixData.query("MyCollection")
.eq("searchField", searchResult)
.find()
.then((results) => {
if (results.totalCount > 0) {
$w("#myRepeater").data = results.items;
} else {
$w('#noResultsMsg').show();
}
})
.catch((err) => {
let errorMsg = err;
});
}