angular.js - 请教各位关于 angular 和 react 的问题.
習慣沉默
習慣沉默 2017-05-15 17:00:03
0
2
471

请教各位关于 angular 和 react 的问题.

在angular.js中我可以将多个 restrict: A 的directive 应用到同一个标签上. 在react中有没有这种类似的等价的应用方式?

我在网上搜索的, 大家都说 react 中必须写一个 component的方式, 那这样的话, 如果想要完成 angular.js的那种操作, 应该怎么去做呢. 或者有什么东西我不知道可以完成这样的操作?

比如我写了两个 directive, 一个 draggable 一个 scaleable. 在angular中, 直接在两个 directive 的link中绑定事件就行了.

在react中, 需要嵌套两层component才行吗

请大家赐教

習慣沉默
習慣沉默

reply all(2)
漂亮男人

If there is component inheritance in react, this function may be possible. . .

Ty80

It can be achieved using the "nested two-layer component" mentioned by the questioner. This should also be the standard implementation method in react.
This is called High-order Components

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!