我们如何在使用 React 时更改微软团队的图标
通过我的React JS Web应用程序中的MS Teams功能集成共享。 下面的解决方案正在工作,但我需要每次查看MS图标,也需要删除并添加启动器,我也想更改该图标并将相同的功能赋予我的UI组件
const msTeamsLauncherUrl = 'https://teams.microsoft.com/share/launcher.js';
const handleclick = () => {
const ele = document.getElementById('teams-share');
if (ele) {
document.body.removeChild(ele);
}
if (document.querySelectorAll(`[src="${msTeamsLauncherUrl}"]`).length === 0) {
const script = document.createElement('script');
if (script) {
script.src = msTeamsLauncherUrl;
script.id = 'teams-share';
document.body.appendChild(script);
}
}
Integrate share via ms teams features in my react js web app.
The below solution is working but I need to remove and add a launcher every time to see the ms ICON, also I want to change that icon and give the same functionality to my UI component
const msTeamsLauncherUrl = 'https://teams.microsoft.com/share/launcher.js';
const handleclick = () => {
const ele = document.getElementById('teams-share');
if (ele) {
document.body.removeChild(ele);
}
if (document.querySelectorAll(`[src="${msTeamsLauncherUrl}"]`).length === 0) {
const script = document.createElement('script');
if (script) {
script.src = msTeamsLauncherUrl;
script.id = 'teams-share';
document.body.appendChild(script);
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论