Blame view

example/table/render-scope.html 1.22 KB
cc35f3f0   Imshann   feat(table): 优化组件
1
2
3
4
5
  <!DOCTYPE html>
  <html>
  
  <head>
      <meta charset="UTF-8" />
a4efb55f   Imshann   feat(table): 优化组件
6
      <title>Render作用域</title>
cc35f3f0   Imshann   feat(table): 优化组件
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  </head>
  
  <body style="padding: 50px;">
      <div ng-app="esNgAntd" ng-controller="mainCtrl">
          <div class="container">
              <antd-table columns="columns" d-source="dataSource"></antd-table>
          </div>
      </div>
      <script src="https://cdn.staticfile.org/angular.js/1.2.28/angular.min.js"></script>
      <script src="../../dist/ng-antd.js"></script>
      <script>
          angular
              .module("esNgAntd")
              .controller("mainCtrl", function ($scope) {
                  $scope.columns = [
                      {
                          title: "AAA",
                          key: "name",
                          render(value, item, index) {
                              return `<div>{{value}} - {{item.name}} {{index}}</div>`;
                          }
                      },
                  ];
  
                  $scope.dataSource = [
                      {
                          id: 1,
                          name: "AAA",
                      },
                      {
                          id: 2,
                          name: "BBB",
                      },
                  ];
              });
      </script>
  </body>
  
  </html>