当前位置: 首页 > news >正文

网站建设的风格设置网站转化率低

网站建设的风格设置,网站转化率低,网站建设160页答案,推广引流图片上一篇文章我们使用Teams Toolkit 来创建、运行 tab app。这篇文章我们深入来分析看一下tab app 的代码。 先打开代码目录#xff0c;可以看到在 src 目录下有入口文件 index.tsx#xff0c;然后在 components 目录下有更多的一些 tsx 文件#xff0c;tsx 是 typescript的一…上一篇文章我们使用Teams Toolkit 来创建、运行 tab app。这篇文章我们深入来分析看一下tab app 的代码。 先打开代码目录可以看到在 src 目录下有入口文件 index.tsx然后在 components 目录下有更多的一些 tsx 文件tsx 是 typescript的一种扩展文件主要用于 react 开发。 我们打开 index.tsx看一下代码。 import React from react; import ReactDOM from react-dom; import App from ./components/App; import ./index.css;ReactDOM.render(App /, document.getElementById(root));可以看到代码极其简单明了就是一个 App那我们就打开 App.tsx 看看。 import { Provider, teamsTheme } from fluentui/react-northstar; import Privacy from ./Privacy; import TermsOfUse from ./TermsOfUse; import Tab from ./Tab; import TabConfig from ./TabConfig; import { useTeams } from msteams-react-base-component;.........export default function App() {const { theme } useTeams({})[0];return (Provider theme{theme || teamsTheme} stylesRouterRoute exact path/Redirect to/tab //RouteRoute exact path/privacy component{Privacy} /Route exact path/termsofuse component{TermsOfUse} /Route exact path/tab component{Tab} /Route exact path/config component{TabConfig} ///Router/Provider); }App.tsx 也算简单有几个地方需要我们注意的第一个就是调用了 useTeams() 方法来获取当前的 teams 的themeteams实际上有几个不同的theme调用 “msteams-react-base-component” 的 useTeams() 就能够拿到当前的 theme然后把 theme 设置给了 Provider在 Router方面则一看就明白配置了一些路径和对应的 component。 这些路径实际上在 manifest.json 里有用到。我们打开 /build/appPackage/manifest.local.json 文件我们可以看到 {...developer: {name: Teams App, Inc.,websiteUrl: https://localhost:53000,privacyUrl: https://localhost:53000/index.html#/privacy,termsOfUseUrl: https://localhost:53000/index.html#/termsofuse},configurableTabs: [{configurationUrl: https://localhost:53000/index.html#/config,canUpdateConfiguration: true,scopes: [team,groupchat]}],staticTabs: [{entityId: index,name: Personal Tab,contentUrl: https://localhost:53000/index.html#/tab,websiteUrl: https://localhost:53000/index.html#/tab,scopes: [personal]}],.... }Privacy.tsx 和 TermsOfUse.tsx 非常简单我们不在展开我们先来看一下 TabConfig.tsx。简化后的内容如下 import { app, pages } from microsoft/teams-js;class TabConfig extends React.Component {render() {app.initialize().then(() {pages.config.registerOnSaveHandler((saveEvent) {const baseUrl https://${window.location.hostname}:${window.location.port};pages.config.setConfig({suggestedDisplayName: My Tab,entityId: Test,contentUrl: baseUrl /index.html#/tab,websiteUrl: baseUrl /index.html#/tab,}).then(() {saveEvent.notifySuccess();});});pages.config.setValidityState(true);});return (div.../div);} }这个基本是 tab 配置页面的标准写法调用 app.initialize() 方法然后注册一个 “Save” buttton 的回调函数在这个回调函数里调用 pages.config.setConfig() 函数来告诉 Teams我们新建的tab的配置新建的tab 的url是什么。 注册完后调用了 pages.config.setValidityState(true); 来告诉 Teams我们的 config 页面已经配置好了可以让用户来点击 Save 按钮了。这里面有点绕但如果各位仔细看上面的代码也不难理解。 我们再来整理一下这个流程 app.initialize().then(() {pages.config.registerOnSaveHandler((saveEvent) { // 注册回调函数当用户点击 Save 按钮时这个方法会被触发const baseUrl https://${window.location.hostname}:${window.location.port};pages.config.setConfig({ // 告诉 Teams 新建的 tab 的具体情况比如tab 名字和 urlsuggestedDisplayName: My Tab,entityId: Test,contentUrl: baseUrl /index.html#/tab,websiteUrl: baseUrl /index.html#/tab,}).then(() {saveEvent.notifySuccess(); // 告诉 TeamsSave点击事件处理完毕});});pages.config.setValidityState(true); // 告诉 Teams可以允许用户点击 Save 按钮});return (div.../div // 返回 config 页面的 html 内容);*/index.html#/tab 对应到的是 Tab component对于 Tab 具体页面里基本都是React的一些写法我这里就不再展开讲 React 开发了值得一提的是我们应该尽量使用 fluentui 和 msteams-react-base-component 库让使用 React 开发teams tab更加方便并且风格和teams更加一致。
http://www.pierceye.com/news/91095/

相关文章:

  • 网站健设推广产品多少钱商业网站开发的实训小结怎么写
  • 优秀的网站建设推荐做百度推广是网站好还是阿里好
  • 响应式网站开发费用做不规则几何图形的网站
  • 西安网站建设优化集团门户网站建设不足
  • 深圳建网站的公企业做网站有什么用
  • wordpress插件 2017南宁seo排名外包
  • 在淘宝上开网店的详细步骤丹东网站seo
  • 网站建设外包公司招聘发帖子有哪些app平台
  • 网站风格发展趋势快设计
  • 稳定的网络建站咨询电话正规网站建设咨询电话
  • 请人代做谷歌外贸网站做购彩网站是怎么盈利的
  • 网站内链怎么删除wordpress如何下载
  • 深圳网站公司有了域名搭建网站详细步骤
  • 主机宝 建设网站怎么知道网站哪家公司做的
  • 1元做网站方案城乡建设住房建设厅官方网
  • 厦门网站网页设网页素材html
  • 活字格能开发企业网站吗商品门户网站解决方案
  • 网站虚拟主机内存不足能不能链接美工怎么做网站效果图
  • 网站版建设软件开发培训班有哪些
  • 舟山市城市建设档案馆网站武夷山景区网站建设特点
  • 北京建设工程质量总站网站哈尔滨网站只做
  • 做外单网站有哪些网站开发工程师需要什么技术
  • 跨境电商自己做网站引流会宁县建设局网站
  • 对于学校网站建设的建议google推广公司哪家好
  • 国外做装饰画的网站公司logo设计图片欣赏
  • 宿州外贸网站建设公司工信部资质查询网站
  • 动漫做暧视频网站用手机制作动画的app
  • 网站备案 域名证书帝国cms响应式网站模板
  • 一个电信ip做网站卡不卡企业网站建设排名资讯
  • 网站建设论文的开题报告制作一个app软件需要多少时间