将一个SPFX Web部件值传递给另一个的可能性 [英] Possibility of Passing one SPFX web part value to another

查看:62
本文介绍了将一个SPFX Web部件值传递给另一个的可能性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

我需要将一个SharePoint Framework客户端Web部件(APP)值转移到另一个。

I need to transfer one SharePoint Framework Client side web part(APP) value into another.

我有在互联网上找不到与此相关的任何内容。

I had not found anything related to this in internet.

情节是:

我在一个页面中有两个SPFX应用程序。

I have two SPFX apps in a page.

一个应用程序有一个下拉列表。在下拉列表值的更改事件中,我想刷新第二个应用程序。

one App is having a drop down list. On change event of drop down list value, i want to refresh that second App.

任何人都可以帮我知道这是否可行?

Can anyone help me to know if this is possible?

推荐答案

在此期间我分享您可以通过以下链接"如何在SPFx Web部件之间共享数据":

In the meantime I share you the following link "How to share data between SPFx web part ":

https://dev.office.com/sharepoint/docs/spfx/web-parts/guidance/tutorial -share-data-between-web-parts-global-variable

我认为目前没有任何文档记录,但是你可以尝试使用socket.io如果您在第一个SPFx Web部件中更改了某些内容,则要有实时通知。

I think for the moment there is nothing of well documented, however you can try to use socket.io to have a real time notification, if you have changed something in the first SPFx web part.

https://socket.io/

从理论上讲,您可以使用这种架构:

Theoretically you can use this kind of architecture:

SPFx 1 SocketIO Client - > &nb的sp; SocketIO Server - > SPFx 2 SocketIO客户端

SPFx 1 SocketIO Client -> SocketIO Server -> SPFx 2 SocketIO Client

以这种方式,您已经更改了下拉列表中的值(SPFx 1),您可以在第二个Web部件中发送此信息并触发代码。

In this way after that you have changed the value in the drop down (SPFx 1) you can send this info in the second web part and triggering the code.

第二个简单方案可能只使用一个Web部件。

The second simple scenario could be to use only one web part.

亲切的问候, 

Kind regards, 


这篇关于将一个SPFX Web部件值传递给另一个的可能性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆