从vue迁移到react

by Gupta Garuda

通过古普塔·歌鲁达(Gupta Garuda)

从AngularJS迁移到React-您如何衡量性能提升? (Migrating from AngularJS to React — how do you measure your performance gains?)

Are you looking into migrating a large AngularJS single page application to React? If so, you may be wondering what sort of performance gains you are going to get with React and how the code will morph (with state management libraries Redux or Mobx).

您是否正在考虑将大型AngularJS单页应用程序迁移到React? 如果是这样,您可能想知道React将带来什么样的性能提升以及代码将如何变形(使用状态管理库Redux或Mobx)。

In this post, I’ll try to answer some of these questions, and give you a lot of data you can use to make more informed decisions.

在本文中,我将尝试回答其中的一些问题,并为您提供大量可用于做出更明智决策的数据。

First, I will go over the performance and memory profiles of various UI scenarios implemented using AngularJS, React/Redux and React/Mobx. We will compare and contrast the performance of these frameworks on measures like script execution time, frames per sec, and usedJSHeapSize for each scenario.

首先,我将介绍使用AngularJS,React / Redux和React / Mobx实现的各种UI场景的性能和内存配置文件。 我们将在每种情况下在脚本执行时间,每秒帧数和usedJSHeapSize等指标上比较和对比这些框架的性能。

I provided the links to the test pages and source code so you can try out those scenarios and can review the code to get a feel for constructs that React (with Redux or Mobx) will bring to the table.

我提供了指向测试页面和源代码的链接,因此您可以尝试这些场景并可以查看代码,以使React(带有Redux或Mobx)将带到表中的构造有个感觉。

性能测试设置 (Performance test setup)

To evaluate the performance of AngularJS and React, I created a benchmark application, a stock ticker dashboard. This application shows a list of stocks and has some controls to automate UI test actions. For each stock, the application shows the ticker symbol, company name, sector name, current price, volume and simple moving averages (10 days, 50 days and 200 days), and a visual indicator showing whether the price went up or down. The test dataset consists of 5000 stock tickers and is loaded during the page load via a script tag.

为了评估AngularJS和React的性能,我创建了一个基准应用程序,一个股票行情显示板。 该应用程序显示了股票列表,并具有一些控件来自动执行UI测试操作。 对于每只股票,应用程序均显示股票代码,公司名称,行业名称,当前价格,交易量和简单移动平均线(10天,50天和200天),以及直观的指示器,显示价格是涨还是跌。 测试数据集由5000个股票行情自动收录器组成,并在页面加载期间通过脚本标签加载。

I created three versions of this application using AngularJS, React/Redux, and React/Mobx. This enables us to easily compare the performance metrics for each scenario across the frameworks.

我使用AngularJS,React / Redux和React / Mobx创建了该应用程序的三个版本。 这使我们能够轻松比较跨框架的每个方案的性能指标。

测试方案 (Test Scenarios)

  • Switching views

    切换检视

    We navigate through a list of 5000 stock tickers showing 150 tickers at a time every 0.5sec. This scenario measures how quickly the framework can update the view when the visible collection data model changes.

    我们浏览5000个股票行情清单,每0.5秒一次显示150个股票行情。 此方案测量可见集合数据模型更改时框架更新视图的速度。

    Real world use-case: route changes, paging through a listview, virtual scroll, and so on.

    现实中的用例:路由更改,通过列表视图进行分页,虚拟滚动等。

  • Adding tickers

    添加股票行情

    We add 50 tickers to the visible collection every 100ms until we show the entire collection of 5000 tickers. This scenario measures how quickly the framework can create new items. Showing 5000 tickers is not a realistic scenario, but we can visualize the limits where things will fall apart with each framework.

    我们每100ms向可见的集合中添加50个标记,直到显示5000个标记的整个集合。 此方案测量框架可以多快地创建新项目。 显示5000个报价不是现实的情况,但是我们可以可视化每个框架将崩溃的限制。

    Real world use-case: Pinterest style infinite scroll where new UI elements are added to the DOM as the user scrolls.

    现实中的用例:Pinterest样式的无限滚动,其中在用户滚动时将新的UI元素添加到DOM。

  • Quick Updates on Price/Volume

    价格/数量快速更新

    We render 1500 tickers and start updating price/volume data for random tickers once every 10ms. This scenario measures how quickly frameworks can apply the partial updates to the UI.

    我们渲染1500个股票,并开始每10ms更新一次随机股票的价格/交易量数据。 此方案测量框架可以多快将部分更新应用于UI。

    Real world use-case: updates to presence indicators, likes, retweets, claps, stock prices, and so on.

    现实世界的用例:状态指示器的更新,如赞,转发,拍手,股票价格等。

  • Removing tickers

    删除股票行情

    We will first add all 5000 tickers and then start removing 50 tickers from the visible collection once every 100ms.

    我们将首先添加所有5000个股票,然后开始每100ms从可见集合中删除50个股票。

All the examples are written in Typescript and the compilation/bundling is done using Webpack. The Readme page for source URL lists the instructions to build and run the applications.

所有示例均以Typescript编写,并且使用Webpack进行了编译/捆绑。 源URL的自述页面列出了构建和运行应用程序的说明。

  • AngularJS — https://guptag.github.io/js-frameworks/AngularJS/examples/angularjs-perf-test/index.html (Source)

    AngularJS- https ://guptag.github.io/js-frameworks/AngularJS/examples/angularjs-perf-test/index.html( 源 )

  • React/Redux — https://guptag.github.io/js-frameworks/Redux/examples/redux-perf-test/index.html

    React / Redux- https: //guptag.github.io/js-frameworks/Redux/examples/redux-perf-test/index.html

    (

    (

    Source)

    来源 )

  • React/Mobx — https://guptag.github.io/js-frameworks/Mobx/examples/mobx-perf-test/index.html

    React / Mobx- https: //guptag.github.io/js-frameworks/Mobx/examples/mobx-perf-test/index.html

    (

    (

    Source)

    来源 )

在我们开始之前... (Before we start…)

  • All the below metrics are measured on Win10/Intel Xeon E5 @ 2.4GHz, 6 core, 32GB desktop with Chrome browser v60. The numbers will change on different machines/browsers.

    以下所有指标均在Win10 / Intel Xeon E5 @ 2.4GHz,6核,32GB台式机和Chrome浏览器v60上进行测量。 数字将在不同的机器/浏览器上改变。
  • To see the accurate heap memory data on the test pages, open Chrome with ‘--enable-precise-memory-info’ flag.

    要在测试页上查看准确的堆内存数据,请使用' --enable-precise-memory-info '标志打开Chrome。

  • React is a library rather than a full-fledged framework like AngularJS. In this post, I used the term framework for simplicity.

    React是一个库,而不是像AngularJS这样的成熟框架。 在本文中,为简单起见,我使用了术语框架。
  • Test pages show live JavaScript heap size as Memory.

    测试页将实时JavaScript堆大小显示为“内存”。

    About javascript heap size: In Chrome TaskManager,

    关于javascript堆大小:在Chrome TaskManager中,

In Chrome TaskManager, “The Memory column represents native memory. DOM nodes are stored in native memory. If this value is increasing, DOM nodes are getting created. The JavaScript Memory column represents the JS heap. This column contains two values. The value you’re interested in is the live number (the number in parentheses). The live number represents how much memory the reachable objects on your page are using. If this number is increasing, either new objects are being created, or the existing objects are growing. From Fix Memory Issues by Kayce Basques

在Chrome TaskManager中,“ 内存列代表本机内存。 DOM节点存储在本机内存中。 如果此值增加,则将创建DOM节点。 JavaScript内存列代表JS堆。 此列包含两个值。 您感兴趣的值是实时数字(括号中的数字)。 实时数字表示页面上的可访问对象正在使用的内存量。 如果此数目增加,则说明正在创建新对象,或者现有对象正在增加 。 凯西·巴斯克(Kayce Basques)的修复内存问题

  • About Frames per second:

    关于每秒帧数:

Most devices today refresh their screens 60 times a second. If there’s an animation or transition running, or the user is scrolling the pages, the browser needs to match the device’s refresh rate and put up one new picture, or frame, for each of those screen refreshes. Each of those frames has a budget of just over 16ms (1 second / 60 = 16.66ms). In reality, however, the browser has housekeeping work to do, so all of your work needs to be completed inside 10ms. When you fail to meet this budget, the frame rate drops, and the content judders on screen. This is often referred to as jank, and it negatively impacts the user’s experience. From Rendering Performance by Paul Lewis

如今,大多数设备每秒刷新屏幕60次。 如果正在运行动画或过渡,或者用户正在滚动页面,则浏览器需要匹配设备的刷新率,并为每个屏幕刷新放置一张新图片或一帧。 这些帧中的每个帧的预算刚好超过16毫秒(1秒/ 60 = 16.66毫秒)。 但是,实际上,浏览器需要执行客房整理工作,因此您的所有工作都需要在10毫秒内完成。 如果您无法满足此预算,则帧速率会下降,并且内容闪烁。 这通常称为垃圾邮件,会对用户的体验产生负面影响。 从保罗·刘易斯的渲染表现

DOM-AngularJS组件与React组件 (DOM - AngularJS Components vs. React Components)

AngularJS directives (or components) create an extra wrapper element around the template. For simple views, this is not an issue. However, in complex views containing a large number of directives (especially when they are repeated within ng-repeat), all the extra elements will add up to the total size of the DOM tree — potentially impacting memory, selector performance, and so on.

AngularJS指令(或组件)在模板周围创建了一个额外的包装器元素。 对于简单的视图,这不是问题。 但是,在包含大量指令的复杂视图中(尤其是在ng-repeat中重复执行这些指令时),所有额外的元素加起来将达到DOM树的总大小-可能会影响内存,选择器性能等。

Although you can set ‘replace=true’ property to disable rendering the wrapper element, it causes a bunch of issues and is currently marked as deprecated.

尽管您可以设置'replace = true'属性以禁用呈现wrapper元素,但它会引起很多问题,并且当前标记为deprecated 。

Here is the rendered HTML for the ticker component in AngularJS:

这是AngularJS中股票行情显示组件的渲染HTML:

Here is rendered HTML for the similar ticker component in React:

这是React中类似的代码组件的呈现HTML:

In our specific example, AngularJS created an additional 1400 DOM nodes compared to React for rendering the same number of tickers (200).

在我们的特定示例中,与React相比,AngularJS创建了额外的1400个DOM节点来渲染相同数量的代码(200个)。

方案1-切换视图 (Scenario 1 — Switching Views)

We navigate through a list of 5000 tickers showing 150 tickers at a time every 0.5sec.

我们浏览5000个滴答声的列表,每0.5秒一次显示150个滴答声。

The below chart plots the script execution time for each refresh from Chrome’s performance timeline. AngularJS consistently took >200ms to delete the existing 150 tickers and to show the new ones. Whereas React/Redux did the same work within 90–100ms (half the time compared to ng1). The React/Mobx version took slightly more time than the Redux version, but not far from it.

下表绘制了Chrome性能时间轴上每次刷新的脚本执行时间。 AngularJS持续花费200毫秒以上的时间来删除现有的150个股票并显示新的股票。 而React / Redux在90-100ms内完成了相同的工作(与ng1相比,时间缩短了一半)。 React / Mobx版本比Redux版本花费了更多时间,但相差不远。

The below chart shows the frames per sec(fps) as the refresh happens. The Redux and Mobx versions stayed around 45fps whereas AngularJS stayed around 30 fps during the entire run.

下表显示了刷新发生时的每秒帧数(fps)。 在整个运行过程中,Redux和Mobx版本保持大约45 fps,而AngularJS保持大约30 fps。

内存和GC暂停 (Memory & GC pauses)

The below chart shows the JavaScript heap size (‘usedJSHeapSize’) measured during the refresh. Both the AngularJS and Mobx versions showed a staircase pattern for the memory consumption, indicating that Chrome kicked in the GC to reclaim the memory. The Redux version is super consistent with its low memory profile all throughout the run.

下表显示了刷新期间测量JavaScript堆大小(“ usedJSHeapSize”)。 AngularJS和Mobx版本都显示了内存消耗的阶梯模式,表明Chrome浏览器加入了GC以回收内存。 在整个运行过程中,Redux版本与其低内存配置文件非常一致。

Let’s closely look into the timeline profiles for all the three versions.

让我们仔细查看所有三个版本的时间线配置文件。

AngularJS execution caused several GC pauses as the ticker list gets refreshed. V8 tries to hide GC pauses by scheduling them during the unused chunks of idle times to improve the UI responsiveness. Contrary to this ideal behavior, GC pauses happened during the script execution contributing to the overall execution time.

随着股票清单的刷新,AngularJS的执行导致了几次GC暂停。 V8尝试通过在未使用的空闲时间块中安排GC暂停来隐藏GC暂停,以提高UI响应能力 。 与这种理想行为相反,GC暂停在脚本执行期间发生,这占了整个执行时间。

The Redux performance profile shows no GC pauses whatsoever during the script execution.

Redux性能配置文件显示在脚本执行过程中,GC均未暂停。

The Mobx profile shows few GC pauses, but not as many as the AngularJS version.

Mobx配置文件显示的GC暂停很少,但不如AngularJS版本那么多。

方案2-添加股票行情 (Scenario 2 — Adding Tickers)

We will add 50 tickers to the visible collection every 100ms until we show all the tickers. The result of showing all 5000 tickers is not a realistic scenario, but it would be interesting to see how each framework handles it.

我们将每100毫秒将50个股票添加到可见集合中,直到我们显示所有股票。 显示所有5000个标记的结果不是现实的情况,但是看看每个框架如何处理它会很有趣。

The below chart plots the script execution time from Chrome’s performance timeline. In the case of AngularJS, the script execution time linearly increased as more and more tickers were added to the page. AngularJS took more time to add new tickers right from the start compared to the other versions.

下图从Chrome的性能时间表绘制了脚本执行时间。 对于AngularJS,随着越来越多的代码添加到页面中,脚本执行时间线性增加。 与其他版本相比,AngularJS从一开始就花费了更多时间来添加新的代码。

Interestingly, the Redux and Mobx versions show impressive performance even towards the right side of the chart with thousands of tickers on the page. React’s virtual DOM diffing algorithm is showing its strength compared to AngularJS’s dirty checking.

有趣的是,Redux和Mobx版本甚至在图表的右侧也显示了令人印象深刻的性能,页面上有成千上万的报价。 与AngularJS的脏检查相比,React的虚拟DOM差异算法正在展示其优势。

With AngularJS, adding new items caused jank in the browser right from the start (red bars) and the number of frames per second dropped from 60 early on and never recovered (green area) during the entire add operation.

使用AngularJS,添加新项会从一开始就在浏览器中造成锯齿(红色条),并且每秒帧数从60早就下降,并且在整个添加操作期间从未恢复(绿色区域)。

Redux created jank once early-on, but it is all clear until we crossed the halfway point of adding new tickers. FPS also nicely recovered to 60 in between the add operations.

Redux早些时候就创建了jank,但直到我们超过添加新的代码的中间点时,一切都是清楚的。 在添加操作之间,FPS也很好地恢复到60。

Mobx caused jank few times more times than Redux, but nowhere close to AngularJS.

Mobx造成jank的次数是Redux的几倍,但远不及AngularJS。

内存和GC事件 (Memory & GC events)

Redux consumed about half the heap size as AngularJS during the entire run. Mobx stayed in between.

在整个运行过程中,Redux消耗的堆大小约为AngularJS的一半。 Mobx停留在两者之间。

Adding new tickers also triggered some GC pauses with AngularJS (almost once with every add operation). Redux triggered fewer GC pauses overall. Mobx started to trigger more GC pauses towards the end as we added more and more tickers to the list.

添加新的代码也触发了AngularJS的GC暂停(每次添加操作几乎都暂停了一次)。 Redux总体上触发了较少的GC暂停。 随着我们在列表中添加越来越多的行情收录器,Mobx开始在结尾处触发更多的GC暂停。

方案3-快速更新价格/数量 (Scenario 3 — Quick Updates to Price/Volume)

This is the most common scenario in the real-time applications. Once the view is rendered, there will be a quick succession of updates coming into the application either via web-sockets, xhr calls, and so on. Imagine the use-cases like presence updates, stock price changes, likes/retweets/claps count changes, and more. Let’s see how each framework fares in this scenario.

这是实时应用程序中最常见的情况。 呈现视图后,将通过Web套接字,xhr调用等快速连续地将更新引入应用程序。 想象一下用例,例如状态更新,股价变化,点赞/转发/拍张数量更改等。 让我们看看每种框架在这种情况下的表现。

All the below metrics are taken with 1500 tickers on the page and when price/volume changes are happening every 10ms.

以下所有指标都是在页面上以1500个滴答作响的,并且每10毫秒发生一次价格/数量变化。

AngularJS again struggled to keep up with the updates happening in quick succession. Script execution for each update took about 35ms. Redux took 6ms to update the view. Mobx shines, updating the view within 2ms. Mobx’s derivation graph knows exactly which component to update based on which observable’s state is changed.

AngularJS再次努力跟上快速连续更新的步伐。 每次更新的脚本执行大约需要35毫秒。 Redux用了6毫秒来更新视图。 Mobx发光,在2ms内更新视图。 Mobx的推导图可根据更改的可观察状态准确地知道要更新的组件。

Here are the timeline profiles showing the script execution for each version.

以下是时间轴配置文件,显示了每个版本的脚本执行情况。

FPS consistently stayed at 60 with Redux and Mobx, whereas it hovered a little below 30 with AngularJS.

Redux和Mobx的FPS始终保持在60,而AngularJS则保持在30以下。

方案4-删除股票代码 (Scenario 4 — Deleting Tickers)

We will add all 5000 tickers to the page and start removing 50 tickers from the visible collection every 100ms.

我们将向页面添加所有5000个标记,并开始每100毫秒从可见集合中删除50个标记。

The below images show the performance profile of the initial delete iterations. AngularJS is almost 4x slower compared to React versions. Redux and Mobx took a little more time in the initial iterations but settled between 50–70ms for each delete operation.

下图显示了初始删除迭代的性能概况。 与React版本相比,AngularJS几乎慢了4倍。 Redux和Mobx在最初的迭代中花费了一些时间,但每次删除操作的时间在50-70ms之间。

It’s pretty clear from all the above tests that React gives significant performance gains when compared with AngularJS.

从以上所有测试中可以很明显地看出,与AngularJS相比,React可以显着提高性能。

As the applications grow bigger and views get more complex, the runtime profile of the frameworks starts to differ in their various ways. Our objective was to replicate the scenarios we were targeting for, measure the performance/memory impact, and look at the pro/cons of the constructs with each framework.

随着应用程序的增长和视图的复杂化,框架的运行时配置文件开始以各种方式出现差异。 我们的目标是复制我们要针对的场景,衡量性能/内存影响,并查看每个框架的构造的利弊。

Even with the most performant framework out there, we still need to apply a lot of discipline and follow the right patterns to make the applications scalable and performant.

即使有最高性能的框架,我们仍然需要运用大量的纪律并遵循正确的模式以使应用程序具有可扩展性和高性能。

I go over the core concepts, benefits, and gotchas of Redux and Mobx in a separate post.

我将在另一篇文章中介绍Redux和Mobx的核心概念,优势和陷阱。

Thanks for reading. Hope this is helpful.

谢谢阅读。 希望这会有所帮助。

P.S. Thanks to Shyam Arjarapu and Adam Carr for reviewing this article.

PS感谢Shyam Arjarapu和Adam Carr审阅了本文。

翻译自: https://www.freecodecamp.org/news/measuring-performance-gains-angularjs-to-react-with-redux-or-mobx-fb221517455/

从vue迁移到react

查看全文
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!

相关文章

  1. React学习总结

    文章目录前言react脚手架建立工程1、安装2、创建3、初始化4、运行创建一个helloWorld Demo知识点:1. 目录结构分析2. 创建组件3. JSX注意事项4.绑定数据或对象事件及数据绑定Demo知识点:事件绑定:数据绑定(View->Model&#xf…...

    2024/4/21 2:33:56
  2. 为什么我会选择React+Next.js,而不是Vue或Angular?

    本文的目的不是要对React、Vue和Angular三者进行比较,已经有许多人对这个话题进行了比较深入的探讨。 每个人都有自己的偏好。与其他库和框架相比,我更喜欢使用React构建用户界面。在我解释了为什么之后,也许你也会切换到React,如…...

    2024/5/6 19:59:27
  3. jQuery+angular+react+vue大厂真题汇总

    面试前刷题真有用吗?作为一个兢兢业业的前端代码搬运工,必须仔细观察和询问身边深谙此道的大佬!他们的回复空前统一,大家对此表示了高度认可!刷题的终极奥义:了解问题本质,对知识点进行合理分类…...

    2024/5/3 4:09:13
  4. 2017 年比较 Angular、React、Vue 三剑客(转载)

    为 web 应用选择 JavaScript 开发框架是一件很费脑筋的事。现如今 Angular 和 React 非常流行,并且最近出现的新贵 VueJS 同样博得了很多人的关注。更重要的是,这只是一些新起之秀。 Javascripts in 2017 —— things aren’t easy these days! 那么我们…...

    2024/4/21 2:33:52
  5. 2017 年比较 Angular、React、Vue 三剑客

    2017 年比较 Angular、React、Vue 三剑客 为 web 应用选择 JavaScript 开发框架是一件很费脑筋的事。现如今 Angular 和 React 非常流行,并且最近出现的新贵 VueJS 同样博得了很多人的关注。更重要的是,这只是一些新起之秀。 在这里插入图片描述 Javasc…...

    2024/4/21 2:33:51
  6. [译] 2017 年比较 Angular、React、Vue 三剑客

    原文地址:Angular vs. React vs. Vue: A 2017 comparison原文作者:Jens Neuhaus译文出自:掘金翻译计划本文永久链接:https://github.com/xitu/gold-miner/blob/master/TODO/angular-vs-react-vs-vue-a-2017-comparison.md译者&…...

    2024/4/21 2:33:50
  7. 前端三大框架(Angular Vue React)

    前端,HTML(超文本标记语言),CSS(层叠样式表)和JavaScript(脚本语言) HTML,通常说的h5,其实按标准来说,HTML4的后续版本不带编号了,并保…...

    2024/4/20 20:22:13
  8. 深入比较选择 Angular 还是 React

    我应该选择 Angular 还是 React?现在JS框架两强的格局让许多开发者选择起来很纠结。无论你是一个正在思考如何入门的新手,还是一个为下个项目挑选框架的设计者,或是一个架构师为公司做长远的规划,你都有可能从学习这个主题中受益。…...

    2024/4/20 20:22:11
  9. 各类脚手架安装教程(VUE React Angular)

    个人博客地址,更多精彩内容 Vue CLI cnpm install -g vue/cli #OR yarn global add vue/cli 创建项目 vue create hello-world 查看版本 vue --version #OR vue -Vcreate-react-app cnpm install -g create-react-app #创建项目 create-react-app my-app #创建con…...

    2024/4/26 3:50:19
  10. 从AngularJS到React&Redux —如何迁移您的Web应用

    by Panagiotis Vrs通过Panagiotis Vrs 从AngularJS到React&Redux —如何迁移您的Web应用 (From AngularJS to React & Redux — how to migrate your web app) Some days ago I wanted to start implementing something I had in mind for the past 4 months: …...

    2024/4/20 20:22:09
  11. Angular vs. React - the tie breaker

    原文 https://www.airpair.com/angularjs/posts/angular-vs-react-the-tie-breaker 1. Introduction A short while ago, our team had to choose a technology for Wixs flagship product, the html wysiwyg website editor. It is a large single-page application, with co…...

    2024/4/21 2:33:49
  12. react 圆角_角vs和React

    react 圆角JavaScript being the language of the web, has new frameworks and libraries developed frequently, take it or not there has always been an influence on web developers to be in the race to learn, innovate and contribute to this wonderful growing com…...

    2024/4/21 2:33:49
  13. 使用web component,React vs Angular vs Vue

    React vs Angular vs Vue VSReactAngularVueNotes创建项目npx create-react-app my-appng new my-appvue create hello-worldangular cli 比react cli好使, angular提供了创建service, components, directive等命令,并且angular支…...

    2024/4/26 23:44:41
  14. AngularReact形式介绍

    by Gulfam Ansari由Gulfam Ansari AngularReact形式介绍 (An introduction to Angular Reactive Forms) Angular uses two different approaches to handle forms. The first one is the Template Driven Approach and the other one is the Reactive Approach. Both approach…...

    2024/4/21 2:33:47
  15. 【angular】开发一个新页面

    前言开发一个新页面途中,总结的一些经验。 页面效果功能1:查询签到/未签到结果功能2:模糊查询功能3:修改状态经验总结 【引入primeng】参考:大神博客、primeNG官网具体使用:当需要一个控件来满足我的需求页面的时候,我…...

    2024/4/21 2:33:45
  16. angular代码高亮代码

    新建立一个管道 keyword.pipe.ts import {Injectable, Pipe, PipeTransform} from angular/core; import {DomSanitizer} from angular/platform-browser;Pipe({name: keyword }) Injectable() export class SearchkeywordPipe implements PipeTransform {constructor(private…...

    2024/4/20 17:02:34
  17. Angular给页面赋值但是页面还没有加载出来赋不上怎么办?

    现在需要用document.querySelector给检索出来的数据赋值。虽然检索数据已经检索到了,但是画面还没来得及显示,这时候想通过document.querySelector给检索出的数据元素赋值怎么办呢? 很简单将赋值语句放到setTimeout里即可 setTimeout(() &g…...

    2024/4/21 2:33:45
  18. Angular:页面上输入框自动获取焦点

    方法一&#xff1a; 在component.ts上&#xff0c;ngOnInit()中写这个方法&#xff1a; document.getElementById(getGuid).focus(); 并且将id绑定到HTML上的输入框上&#xff1a; <input nz-input formControlName"guid" id"getGuid" placeholder&…...

    2024/4/21 2:33:42
  19. angular html页面嵌套,使用AngularJS来实现HTML页面嵌套的方法

    HTML不支持嵌入在HTML页面中的HTML页面。实现这一功能通过使用以下方式&#xff1a;使用Ajax - 让一台服务器来调用获取相应的HTML页面&#xff0c;并将其设置在HTML控件的innerHTML。使用服务器端包含 - JSP&#xff0c;PHP等Web端服务器技术可以在包括动态页面中的HTML页面。…...

    2024/4/21 2:33:41
  20. Angular ionic 创建页面和页面跳转

    一&#xff1a;创建tab4模块 cd到项目目录&#xff1b;通过ionic g page 页面名称&#xff1b; PS E:\Angular\ionicdemo01> ng g page tab4 3.删除默认配置在app-routing.module.ts里的路由&#xff1b; 4.在tabs.router.module.ts中&#xff0c;配置tab4 5.在tabs.page.h…...

    2024/4/21 2:33:41

最新文章

  1. 生信技能45 - 基于docker容器运行生信软件

    1. 获取docker镜像 以运行xhmm CNV分析软件为例。 # 搜索仓库镜像 sudo docker search xhmm# 拉取镜像 sudo docker pull ksarathbabu/xhmm_v1.0# 启动镜像,非后台 sudo docker run -it ksarathbabu/xhmm_v1.0 /bin/bash # -i: 交互式操作。 # -t: 终端。 # ksarathbabu/xhmm…...

    2024/5/10 19:22:11
  2. 梯度消失和梯度爆炸的一些处理方法

    在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言&#xff0c;在此感激不尽。 权重和梯度的更新公式如下&#xff1a; w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...

    2024/5/9 21:23:04
  3. K8S容器空间不足问题分析和解决

    如上图&#xff0c;今天测试环境的K8S平台出现了一个问题&#xff0c;其中的一个容器报错&#xff1a;Free disk space below threshold. Available: 3223552 bytes (threshold: 10485760B)&#xff0c;意思服务器硬盘空间不够了。这个问题怎么产生的&#xff0c;又怎么解决的呢…...

    2024/5/9 13:07:02
  4. CSS3 高级- 复杂选择器、内容生成、变形(transform)、过渡(transition)、动画(animation)

    文章目录 一、复杂选择器兄弟选择器:选择平级元素的唯一办法属性选择器:1、通用:基本用不着,太泛了2、自定义:4种伪类选择器:1、目标伪类:2、结构伪类:3、元素状态伪类:4、伪元素选择器:应用于文字,使网页看起来想杂志5、否定伪类:选择器:not([本选择器的条件]) /*…...

    2024/5/9 22:52:41
  5. 【外汇早评】美通胀数据走低,美元调整

    原标题:【外汇早评】美通胀数据走低,美元调整昨日美国方面公布了新一期的核心PCE物价指数数据,同比增长1.6%,低于前值和预期值的1.7%,距离美联储的通胀目标2%继续走低,通胀压力较低,且此前美国一季度GDP初值中的消费部分下滑明显,因此市场对美联储后续更可能降息的政策…...

    2024/5/10 12:36:12
  6. 【原油贵金属周评】原油多头拥挤,价格调整

    原标题:【原油贵金属周评】原油多头拥挤,价格调整本周国际劳动节,我们喜迎四天假期,但是整个金融市场确实流动性充沛,大事频发,各个商品波动剧烈。美国方面,在本周四凌晨公布5月份的利率决议和新闻发布会,维持联邦基金利率在2.25%-2.50%不变,符合市场预期。同时美联储…...

    2024/5/9 15:10:32
  7. 【外汇周评】靓丽非农不及疲软通胀影响

    原标题:【外汇周评】靓丽非农不及疲软通胀影响在刚结束的周五,美国方面公布了新一期的非农就业数据,大幅好于前值和预期,新增就业重新回到20万以上。具体数据: 美国4月非农就业人口变动 26.3万人,预期 19万人,前值 19.6万人。 美国4月失业率 3.6%,预期 3.8%,前值 3…...

    2024/5/4 23:54:56
  8. 【原油贵金属早评】库存继续增加,油价收跌

    原标题:【原油贵金属早评】库存继续增加,油价收跌周三清晨公布美国当周API原油库存数据,上周原油库存增加281万桶至4.692亿桶,增幅超过预期的74.4万桶。且有消息人士称,沙特阿美据悉将于6月向亚洲炼油厂额外出售更多原油,印度炼油商预计将每日获得至多20万桶的额外原油供…...

    2024/5/9 4:20:59
  9. 【外汇早评】日本央行会议纪要不改日元强势

    原标题:【外汇早评】日本央行会议纪要不改日元强势近两日日元大幅走强与近期市场风险情绪上升,避险资金回流日元有关,也与前一段时间的美日贸易谈判给日本缓冲期,日本方面对汇率问题也避免继续贬值有关。虽然今日早间日本央行公布的利率会议纪要仍然是支持宽松政策,但这符…...

    2024/5/4 23:54:56
  10. 【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响

    原标题:【原油贵金属早评】欧佩克稳定市场,填补伊朗问题的影响近日伊朗局势升温,导致市场担忧影响原油供给,油价试图反弹。此时OPEC表态稳定市场。据消息人士透露,沙特6月石油出口料将低于700万桶/日,沙特已经收到石油消费国提出的6月份扩大出口的“适度要求”,沙特将满…...

    2024/5/4 23:55:05
  11. 【外汇早评】美欲与伊朗重谈协议

    原标题:【外汇早评】美欲与伊朗重谈协议美国对伊朗的制裁遭到伊朗的抗议,昨日伊朗方面提出将部分退出伊核协议。而此行为又遭到欧洲方面对伊朗的谴责和警告,伊朗外长昨日回应称,欧洲国家履行它们的义务,伊核协议就能保证存续。据传闻伊朗的导弹已经对准了以色列和美国的航…...

    2024/5/4 23:54:56
  12. 【原油贵金属早评】波动率飙升,市场情绪动荡

    原标题:【原油贵金属早评】波动率飙升,市场情绪动荡因中美贸易谈判不安情绪影响,金融市场各资产品种出现明显的波动。随着美国与中方开启第十一轮谈判之际,美国按照既定计划向中国2000亿商品征收25%的关税,市场情绪有所平复,已经开始接受这一事实。虽然波动率-恐慌指数VI…...

    2024/5/7 11:36:39
  13. 【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试

    原标题:【原油贵金属周评】伊朗局势升温,黄金多头跃跃欲试美国和伊朗的局势继续升温,市场风险情绪上升,避险黄金有向上突破阻力的迹象。原油方面稍显平稳,近期美国和OPEC加大供给及市场需求回落的影响,伊朗局势并未推升油价走强。近期中美贸易谈判摩擦再度升级,美国对中…...

    2024/5/4 23:54:56
  14. 【原油贵金属早评】市场情绪继续恶化,黄金上破

    原标题:【原油贵金属早评】市场情绪继续恶化,黄金上破周初中国针对于美国加征关税的进行的反制措施引发市场情绪的大幅波动,人民币汇率出现大幅的贬值动能,金融市场受到非常明显的冲击。尤其是波动率起来之后,对于股市的表现尤其不安。隔夜美国股市出现明显的下行走势,这…...

    2024/5/6 1:40:42
  15. 【外汇早评】美伊僵持,风险情绪继续升温

    原标题:【外汇早评】美伊僵持,风险情绪继续升温昨日沙特两艘油轮再次发生爆炸事件,导致波斯湾局势进一步恶化,市场担忧美伊可能会出现摩擦生火,避险品种获得支撑,黄金和日元大幅走强。美指受中美贸易问题影响而在低位震荡。继5月12日,四艘商船在阿联酋领海附近的阿曼湾、…...

    2024/5/4 23:54:56
  16. 【原油贵金属早评】贸易冲突导致需求低迷,油价弱势

    原标题:【原油贵金属早评】贸易冲突导致需求低迷,油价弱势近日虽然伊朗局势升温,中东地区几起油船被袭击事件影响,但油价并未走高,而是出于调整结构中。由于市场预期局势失控的可能性较低,而中美贸易问题导致的全球经济衰退风险更大,需求会持续低迷,因此油价调整压力较…...

    2024/5/8 20:48:49
  17. 氧生福地 玩美北湖(上)——为时光守候两千年

    原标题:氧生福地 玩美北湖(上)——为时光守候两千年一次说走就走的旅行,只有一张高铁票的距离~ 所以,湖南郴州,我来了~ 从广州南站出发,一个半小时就到达郴州西站了。在动车上,同时改票的南风兄和我居然被分到了一个车厢,所以一路非常愉快地聊了过来。 挺好,最起…...

    2024/5/7 9:26:26
  18. 氧生福地 玩美北湖(中)——永春梯田里的美与鲜

    原标题:氧生福地 玩美北湖(中)——永春梯田里的美与鲜一觉醒来,因为大家太爱“美”照,在柳毅山庄去寻找龙女而错过了早餐时间。近十点,向导坏坏还是带着饥肠辘辘的我们去吃郴州最富有盛名的“鱼头粉”。说这是“十二分推荐”,到郴州必吃的美食之一。 哇塞!那个味美香甜…...

    2024/5/4 23:54:56
  19. 氧生福地 玩美北湖(下)——奔跑吧骚年!

    原标题:氧生福地 玩美北湖(下)——奔跑吧骚年!让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 让我们红尘做伴 活得潇潇洒洒 策马奔腾共享人世繁华 对酒当歌唱出心中喜悦 轰轰烈烈把握青春年华 啊……啊……啊 两…...

    2024/5/8 19:33:07
  20. 扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!

    原标题:扒开伪装医用面膜,翻六倍价格宰客,小姐姐注意了!扒开伪装医用面膜,翻六倍价格宰客!当行业里的某一品项火爆了,就会有很多商家蹭热度,装逼忽悠,最近火爆朋友圈的医用面膜,被沾上了污点,到底怎么回事呢? “比普通面膜安全、效果好!痘痘、痘印、敏感肌都能用…...

    2024/5/5 8:13:33
  21. 「发现」铁皮石斛仙草之神奇功效用于医用面膜

    原标题:「发现」铁皮石斛仙草之神奇功效用于医用面膜丽彦妆铁皮石斛医用面膜|石斛多糖无菌修护补水贴19大优势: 1、铁皮石斛:自唐宋以来,一直被列为皇室贡品,铁皮石斛生于海拔1600米的悬崖峭壁之上,繁殖力差,产量极低,所以古代仅供皇室、贵族享用 2、铁皮石斛自古民间…...

    2024/5/8 20:38:49
  22. 丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者

    原标题:丽彦妆\医用面膜\冷敷贴轻奢医学护肤引导者【公司简介】 广州华彬企业隶属香港华彬集团有限公司,专注美业21年,其旗下品牌: 「圣茵美」私密荷尔蒙抗衰,产后修复 「圣仪轩」私密荷尔蒙抗衰,产后修复 「花茵莳」私密荷尔蒙抗衰,产后修复 「丽彦妆」专注医学护…...

    2024/5/4 23:54:58
  23. 广州械字号面膜生产厂家OEM/ODM4项须知!

    原标题:广州械字号面膜生产厂家OEM/ODM4项须知!广州械字号面膜生产厂家OEM/ODM流程及注意事项解读: 械字号医用面膜,其实在我国并没有严格的定义,通常我们说的医美面膜指的应该是一种「医用敷料」,也就是说,医用面膜其实算作「医疗器械」的一种,又称「医用冷敷贴」。 …...

    2024/5/10 10:22:18
  24. 械字号医用眼膜缓解用眼过度到底有无作用?

    原标题:械字号医用眼膜缓解用眼过度到底有无作用?医用眼膜/械字号眼膜/医用冷敷眼贴 凝胶层为亲水高分子材料,含70%以上的水分。体表皮肤温度传导到本产品的凝胶层,热量被凝胶内水分子吸收,通过水分的蒸发带走大量的热量,可迅速地降低体表皮肤局部温度,减轻局部皮肤的灼…...

    2024/5/9 17:11:10
  25. 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...

    解析如下&#xff1a;1、长按电脑电源键直至关机&#xff0c;然后再按一次电源健重启电脑&#xff0c;按F8健进入安全模式2、安全模式下进入Windows系统桌面后&#xff0c;按住“winR”打开运行窗口&#xff0c;输入“services.msc”打开服务设置3、在服务界面&#xff0c;选中…...

    2022/11/19 21:17:18
  26. 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。

    %读入6幅图像&#xff08;每一幅图像的大小是564*564&#xff09; f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...

    2022/11/19 21:17:16
  27. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...

    win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面&#xff0c;在等待界面中我们需要等待操作结束才能关机&#xff0c;虽然这比较麻烦&#xff0c;但是对系统进行配置和升级…...

    2022/11/19 21:17:15
  28. 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...

    有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows&#xff0c;请勿关闭计算机”的提示&#xff0c;要过很久才能进入系统&#xff0c;有的用户甚至几个小时也无法进入&#xff0c;下面就教大家这个问题的解决方法。第一种方法&#xff1a;我们首先在左下角的“开始…...

    2022/11/19 21:17:14
  29. win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...

    置信有很多用户都跟小编一样遇到过这样的问题&#xff0c;电脑时发现开机屏幕显现“正在配置Windows Update&#xff0c;请勿关机”(如下图所示)&#xff0c;而且还需求等大约5分钟才干进入系统。这是怎样回事呢&#xff1f;一切都是正常操作的&#xff0c;为什么开时机呈现“正…...

    2022/11/19 21:17:13
  30. 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...

    Win7系统开机启动时总是出现“配置Windows请勿关机”的提示&#xff0c;没过几秒后电脑自动重启&#xff0c;每次开机都这样无法进入系统&#xff0c;此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一&#xff1a;开机按下F8&#xff0c;在出现的Windows高级启动选…...

    2022/11/19 21:17:12
  31. 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...

    有不少windows10系统用户反映说碰到这样一个情况&#xff0c;就是电脑提示正在准备windows请勿关闭计算机&#xff0c;碰到这样的问题该怎么解决呢&#xff0c;现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法&#xff1a;1、2、依次…...

    2022/11/19 21:17:11
  32. 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...

    今天和大家分享一下win7系统重装了Win7旗舰版系统后&#xff0c;每次关机的时候桌面上都会显示一个“配置Windows Update的界面&#xff0c;提示请勿关闭计算机”&#xff0c;每次停留好几分钟才能正常关机&#xff0c;导致什么情况引起的呢&#xff1f;出现配置Windows Update…...

    2022/11/19 21:17:10
  33. 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...

    只能是等着&#xff0c;别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚&#xff0c;只能是考虑备份数据后重装系统了。解决来方案一&#xff1a;管理员运行cmd&#xff1a;net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...

    2022/11/19 21:17:09
  34. 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?

    原标题&#xff1a;电脑提示“配置Windows Update请勿关闭计算机”怎么办&#xff1f;win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢&#xff1f;一般的方…...

    2022/11/19 21:17:08
  35. 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...

    关机提示 windows7 正在配置windows 请勿关闭计算机 &#xff0c;然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;关机提示 windows7 正在配…...

    2022/11/19 21:17:05
  36. 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...

    钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...

    2022/11/19 21:17:05
  37. 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...

    前几天班里有位学生电脑(windows 7系统)出问题了&#xff0c;具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面&#xff0c;长时间没反应&#xff0c;无法进入系统。这个问题原来帮其他同学也解决过&#xff0c;网上搜了不少资料&#x…...

    2022/11/19 21:17:04
  38. 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...

    本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法&#xff0c;并在最后教给你1种保护系统安全的好方法&#xff0c;一起来看看&#xff01;电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中&#xff0c;添加了1个新功能在“磁…...

    2022/11/19 21:17:03
  39. 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...

    许多用户在长期不使用电脑的时候&#xff0c;开启电脑发现电脑显示&#xff1a;配置windows更新失败&#xff0c;正在还原更改&#xff0c;请勿关闭计算机。。.这要怎么办呢&#xff1f;下面小编就带着大家一起看看吧&#xff01;如果能够正常进入系统&#xff0c;建议您暂时移…...

    2022/11/19 21:17:02
  40. 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...

    配置windows update失败 还原更改 请勿关闭计算机&#xff0c;电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容&#xff0c;让我们赶快一起来看一下吧&#xff01;配置windows update失败 还原更改 请勿关闭计算机&#x…...

    2022/11/19 21:17:01
  41. 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...

    不知道大家有没有遇到过这样的一个问题&#xff0c;就是我们的win7系统在关机的时候&#xff0c;总是喜欢显示“准备配置windows&#xff0c;请勿关机”这样的一个页面&#xff0c;没有什么大碍&#xff0c;但是如果一直等着的话就要两个小时甚至更久都关不了机&#xff0c;非常…...

    2022/11/19 21:17:00
  42. 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...

    当电脑出现正在准备配置windows请勿关闭计算机时&#xff0c;一般是您正对windows进行升级&#xff0c;但是这个要是长时间没有反应&#xff0c;我们不能再傻等下去了。可能是电脑出了别的问题了&#xff0c;来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...

    2022/11/19 21:16:59
  43. 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...

    我们使用电脑的过程中有时会遇到这种情况&#xff0c;当我们打开电脑之后&#xff0c;发现一直停留在一个界面&#xff1a;“配置Windows Update失败&#xff0c;还原更改请勿关闭计算机”&#xff0c;等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢&#xff0…...

    2022/11/19 21:16:58
  44. 如何在iPhone上关闭“请勿打扰”

    Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...

    2022/11/19 21:16:57