Angular涓搷浣淒OM

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Angular涓搷浣淒OM相关的知识,希望对你有一定的参考价值。

鏍囩锛?a href='http://www.mamicode.com/so/1/on()' title='on()'>on()   false   --   exp   scribe   瀹樻柟鏂囨。   ast   ott   des   

  • 浣跨敤ViewChildren鐩戝惉DOM浜嬩欢
    • 瀹樻柟鏂囨。
    • You can use ViewChildren to get the QueryList of elements or directives from the view DOM. Any time a child element is added, removed, or moved, the query list will be updated, and the changes observable of the query list will emit a new value.
    • View queries are set before the ngAfterViewInit callback is called.
    • 鐢ㄤ簬鐩戝惉浣跨敤浜唍gFor绛夋寚浠ょ殑寰幆div绛夊厓绱犳椂锛宻ubscribe鐨刢hanges鏃惰Е鍙戝湪鎵€鏈塶gFor鍏冪礌涓€涓釜閮界敾瀹屼箣鍚庛€傚洜姝や篃灏卞彲鐢ㄤ簬鍦╪gFor鎸囦护鎵€鏈夊惊鐜粨鏉熷悗瑙﹀彂浜嬩欢澶勭悊閫昏緫銆?/strong>
<!--Tiles-->
<div id="scroll-div-showall-screenshot" class="row scroll-div" *ngIf="currentData; else assetoeeloading" infiniteScroll
  [infiniteScrollDistance]="2" [infiniteScrollThrottle]="50" (scrolled)="onScroll()" [scrollWindow]="false">
  <div #allAssetTiles class="col-12 col-sm-12 col-md-6 col-lg-4 col-xl-3 pb-3"
    *ngFor="let data of currentData; let last = last">
    <amp-oee-tile kpi="oee" [data]="data" [timeframe]="currentTimeFrame"></amp-oee-tile>
  </div>
</div>

import  Component, ElementRef, ViewChildren, QueryList, OnInit, OnDestroy, AfterViewInit  from '@angular/core';

export class OeeOverviewComponent implements OnInit, OnDestroy, AfterViewInit 
  @ViewChildren('allAssetTiles') allAssetTiles: QueryList<any>;

  ngAfterViewInit() 
    this.allAssetTiles.changes.subscribe(t => 
      this.scrollToPreviousPosition();
    );
  

以上是关于Angular涓搷浣淒OM的主要内容,如果未能解决你的问题,请参考以下文章

520蹇箰~ 娴呮瀽 Vue.js 涓偅浜涚┖闂存崲鏃堕棿鐨勬搷浣滐紙濂芥枃鏀惰棌锛侊級

涓€绔欐敹褰曡绠楁満鐭ヨ瘑浣撶郴锛氱畻娉曘€佹搷浣滅郴缁熴€佹暟鎹簱銆佺紪绋嬪疄璺点€佺郴缁熻璁$瓑

http://www.dewen.net.cn/q/14665/涓汉鎰熻鐢ㄤ簩鍒嗘硶鏈€瀹岀編鐨勶紝闇€瑕佹搷浣滅郴缁熸敮鎸侀殢鏈鸿鍙栨寚瀹氫竴琛岀殑鏁版嵁,璨屼技鐜板湪杩樹笉琛岋紝姹熸箹鏁戞€

濡備綍灏嗘暟鎹粠MySQL/MongoDB涓縼绉昏嚦浜戝紑鍙戞暟鎹簱