博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
React概念:声明式
阅读量:2504 次
发布时间:2019-05-11

本文共 1202 字,大约阅读时间需要 4 分钟。

You’ll run across articles describing React as a declarative approach to building UIs.

您将遍历描述React作为构建UI声明性方法的文章。

React made its “declarative approach” quite popular and upfront so it permeated the frontend world along with React.

React使它的“声明式方法”非常流行和前期,因此它与React一起渗透到前端世界。

It’s really not a new concept, but React took building UIs a lot more declaratively than with HTML templates:

这实际上不是一个新概念,但React声明性地构建UI的方式比使用HTML模板要多:

  • you can build Web interfaces without even touching the DOM directly

    您甚至无需直接接触DOM就可以构建Web界面
  • you can have an event system without having to interact with the actual DOM Events.

    您可以拥有一个事件系统,而不必与实际的DOM事件进行交互。

The opposite of declarative is imperative. A common example of an imperative approach is looking up elements in the DOM using jQuery or DOM events. You tell the browser exactly what to do, instead of telling it what you need.

声明的反义性势在必行 。 命令式方法的一个常见示例是使用jQuery或DOM事件在DOM中查找元素。 您告诉浏览器确切的操作,而不是告诉浏览器您需要什么。

The React declarative approach abstracts that for us. We just tell React we want a component to be rendered in a specific way, and we never have to interact with the DOM to reference it later.

React声明式方法为我们抽象了这一点。 我们只是告诉React我们希望组件以特定的方式呈现,并且我们以后不必再与DOM交互来引用它。

翻译自:

转载地址:http://wvqgb.baihongyu.com/

你可能感兴趣的文章
SQL批量删除与批量插入
查看>>
Notes on <High Performance MySQL> -- Ch3: Schema Optimization and Indexing
查看>>
C语言之一般树
查看>>
懂了很多大道理,却依旧过不好一生
查看>>
手工数据结构系列-C语言模拟队列 hdu1276
查看>>
【PyQt5 学习记录】008:改变窗口样式之二
查看>>
android EditText长按屏蔽ActionMode context菜单但保留选择工具功能
查看>>
BUAA 111 圆有点挤
查看>>
c++ 继承产生的名字冲突问题 (1)
查看>>
SQL中on条件与where条件的区别
查看>>
Ubuntu下查看软件版本及安装位置
查看>>
安装IIS
查看>>
动态加载JS(转)
查看>>
shell脚本 inotify + rsync 同步脚本
查看>>
快速实现Magento多语言的设置和产品数据的多语言方法
查看>>
A - Oil Deposits(搜索)
查看>>
hLG2034Fire Maze ---BFS
查看>>
定时Job在IIS中潜在危险-IIS 定期回收
查看>>
Kafka的安装和配置
查看>>
Alpha冲刺(10/10)
查看>>