md-virtual-repeat的问题

时间:2017-01-05 20:45:34

标签: javascript angularjs angular-material

我们在使用Angular Material的应用上遇到了一些IE11性能问题。我调查了一下,显然这是众所周知的,并开始研究解决方案。其中一个是用ng-repeat指令替换大md-virtual-repeat个列表。我试过这个并且结果好坏参半。归结为几个问题:

  1. 除非我从md-virtual-repeat-container md-orient-vertical动态移除md-virtual-repeat-container课程,否则我看不到这些内容。
  2. 我在页面上有多个标签(它是按类别排序的购物页面,每个标签下都有一个列表),只有单击一个标签,然后单击关闭,然后重新单击才会重复这些元素。 LI>
  3. md-virtual-repeat-sizer的div高度非常高(大约2000px,大型列表高达48000px)。
  4. 起初我认为它与嵌套在另一个ng-repeat内有关,但我不确定那是罪魁祸首。以下是相关代码的片段:

    <ng-form name="vmProduct.productsForm" novalidate>
    <div ng-repeat="InventoryItemSubCategory in vmProduct.products | filter: ($scope.selectedGroup !== 'All' || '') && $scope.selectedGroup | filter:$scope.query | groupBy:'InventoryItemSubCategory':'productsByCategory'">
    <h2>{{InventoryItemSubCategory.InventoryItemSubCategory}}</h2>
    <md-content ng-cloak="">
      <md-virtual-repeat-container id="productRepeat">
        <div md-virtual-repeat="product in InventoryItemSubCategory.items">
          <md-card class="product-card" md-theme="default" md-theme-watch>
            <md-card-content>
            </md-card-content>
          </md-card>
        </div>
      </md-virtual-repeat-container>
    </md-content>
    </div>
    </ng-form>
    

    我的另一个想法是由于使用了md-card指令而不是div元素,但我不确定。

    有没有人遇到过这个?任何帮助/方向将不胜感激。

    谢谢!

0 个答案:

没有答案
相关问题