如何解决React TypeScript:如何添加书签按钮,当单击该按钮时,它将向显示您已添加书签的另一页发送消息
我目前遇到一个问题,我想在其中添加用于收藏工作或人员的收藏夹按钮。我只希望在通知页面上显示一段静态文本,说“您已为abc添加了书签。
我不知道该怎么做,如果有人知道解决这个问题的办法,将不胜感激。如果有任何帮助,也可以使用Ionic SDK构建该应用程序。
**这是我的联系页面,其中有一个喜欢的关注按钮。 **
return (
<IonPage>
<IonHeader>
<IonToolbar>
<IonButtons slot="start">
<IonBackButton defaultHref="/" />
</IonButtons>
<IonTitle>Connections</IonTitle>
</IonToolbar>
<IonToolbar>
<IonSearchbar
value={searchText}
onIonChange={(e) => setSearchText(e.detail.value!)}
></IonSearchbar>
</IonToolbar>
</IonHeader>
<IonContent className="ion-padding">
<IonGrid>
<IonRow>
{results.map((connections) => (
<IonCol key={connections.id} size-xs="12" size-md="6" size-lg="4">
<IonCard>
<IonList>
<IonItem>
<IonThumbnail slot="start">
{connections.image}
</IonThumbnail>
<IonButton slot="end" fill="clear" color="secondary" onClick={}>
<IonIcon icon={heartOutline} />
</IonButton>
<IonLabel className="ion-text-wrap">
<IonCardTitle>{connections.name}</IonCardTitle>
<IonCardSubtitle>{connections.role}</IonCardSubtitle>
<IonCardSubtitle>
{connections.location}
</IonCardSubtitle>
</IonLabel>
</IonItem>
<IonCardContent className="ion-text-justify">
The standard chunk of Lorem Ipsum used since the 1500s is
reproduced below for those interested. The standard chunk
of Lorem Ipsum used since the 1500s is reproduced below
for those interested.
</IonCardContent>
<IonItem lines="full">Area: {connections.area}</IonItem>
<IonItem lines="full">
Experience: {connections.experience}
</IonItem>
<IonItem lines="none">Status: {connections.status}</IonItem>
<IonFooter className="ion-text-right">
<IonButton
fill="clear"
routerLink={`/search-connections/${connections.id}`}
>
View Job
</IonButton>
</IonFooter>
</IonList>
</IonCard>
</IonCol>
))}
</IonRow>
</IonGrid>
</IonContent>
</IonPage>
);
};
这是我的通知页面,在该页面上我的页面上显示静态文本,但是我希望在单击“喜欢”按钮而不是放置伪数据时显示该文本。
return (
<IonPage>
<IonHeader>
<IonToolbar>
<IonTitle>Notifications</IonTitle>
</IonToolbar>
</IonHeader>
<IonContent>
<IonList>
<IonItem>
<IonLabel>
<h2>Thank you for applying to...</h2>
<p>We hope to get in touch with you soon about...</p>
</IonLabel>
<IonIcon slot="end" icon={sendOutline} />
</IonItem>
<IonItem>
<IonLabel>
<h2>You have started following...</h2>
</IonLabel>
<IonIcon slot="end" icon={logoTwitter} />
</IonItem>
</IonList>
</IonContent>
</IonPage>
);
};
export default Notifications;
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。