简体   繁体   English

javascript 在创建 ms 团队应用程序时实现问题

[英]javascript implementing problem in creating a ms teams app

I am new at creating Microsoft Apps and i managed to build an app ( group tab ) and install it in Teams.我是创建 Microsoft 应用程序的新手,我设法构建了一个应用程序(组选项卡)并将其安装在 Teams 中。

How can i attach an external javascript file to the Tab.js ?如何将外部 javascript 文件附加到Tab.js

import './MyFunction.js';导入'./MyFunction.js'; //get's ignored //get 被忽略

How can i generally use javascript code in the Tab.js , because it wont even accept the script tag without returning an error?我通常如何在Tab.js中使用 javascript 代码,因为它甚至不会接受脚本标签而不返回错误? Compile with Script - ErrorMessage使用脚本编译 - ErrorMessage

(The only thing i found out was that you need the javascript client sdk , but i cannot find examples or how/where to you use it in the Tab Script) (我发现的唯一一件事是您需要javascript 客户端 sdk ,但我找不到示例或在选项卡脚本中如何/在何处使用它)

To attach one javascript file in another javascript in your example you need to export Myfunction in Myfunction.js and import Myfunction from './Myfunction.js' in Tab.js.要在您的示例中将一个 javascript 文件附加到另一个 javascript 中,您需要在 Myfunction.js 中导出 Myfunction 并在 Tab.js 中从“./Myfunction.js”导入 Myfunction。 For second question you cannot use script tag in Tab.js, in return() function you need to write html code and in render() function you need write functions you want to call.对于第二个问题,您不能在 Tab.js 中使用脚本标记,在 return() function 中,您需要编写 html 代码并在 render() function 中编写您需要的函数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM