0

我已经安装了 ngReact,并且可以使用这篇文章在我的 Angular 1.3 项目中创建一个基本组件(Hello World):https ://www.logilab.org/blogentry/7366955

但我不确定如何在我的 Angular 应用程序中使用 react-data-grid。使用什么组件名称?有人做过吗?我会欢迎一点指导!谢谢!

4

1 回答 1

0

仅仅通过阅读您的文章就不太了解角度,您需要做一些事情。

您需要将 react-data-grid 作为脚本导入,您可以在此处查看他们的操作方式。

在该ReactDataGrid组件可供您使用之后,您可以对链接中的示例执行相同的操作。如果你不使用 jsx,那么看看这里会更好。您的最终代码将是这样的

 // define a React component that displays "Hello {name}"
 var GridComponent = React.createClass({
    render: function() {
       var props = { x: this.props.x, y: this.props.y ...};
       // you can filter the props or just inject this.props
       return React.createElement(ReactDataGrid, props, null);
    }
 });

要使用它,您只需要创建如下所示的网格控制器:

 <div ng-app="app" ng-controller="helloController">
   <react-component name="GridElement" props="yourProps" />
 </div>
于 2017-01-18T12:27:26.123 回答