React Framework Web开发框架
浏览:913 次

1.React概述React源于Facebook的内部项目,以及该公司对市场上所有JavaScript的回应;对MVC框架不满意,我决定为Instagram开发一套网站。2013年5月开源。
React是一个用于构建用户界面的JavaScript库。React是一个UI引擎,是DOM的抽象层,不是webapp的完整解决方案。它遵循组件设计模式、声明性编程范式和函数式编程的概念,使用虚拟DOM有效地操作DOM,遵循从高阶组件到低阶组件的单向数据流,从而使前端app实现高效率。
它是一个JavaScript库,可以简化可视化界面的开发;
它基于JSX语法(JavaScriptXml)。JSX是React的核心组件。它使用xml标记来直接声明接口,该接口与html和js混合;
核心是组件,它封装数据和逻辑。它提高了代码重用率,降低了代码维护的难度。
2.React框架特性1.声明式设计:React使创建交互式UI变得容易。为app的每个状态设计简洁的视图。当数据发生变化时,React可以高效地更新和呈现适当的组件。
2.组件化:构建封装的组件来管理它们自己的状态,然后将它们组合起来形成一个复杂的UI。
3.高效:React通过模拟DOM来最小化与DOM的交互。
4.灵活:无论您现在使用什么技术堆栈,都可以通过引入React来开发新功能,而无需重写现有代码。
3.构建React开发环境1.基本app(传统app):将React核心库(.js文件)导入页面文件。您可以在官方网站上导入地址,也可以自己下载并在本地导入。

(1) 核心库:反应。发展js文件
Template: main
Session:
Session type: db
[unisoft__unisoft] Array ( [permission] => [human_valid] => [passport] => )
Loaded Class:
Zend_Db: /web/unisoft/web.system/Zend/Db.php
Zend_Db_Adapter_Abstract: /web/unisoft/web.system/Zend/Db/Adapter/Abstract.php
Zend_Db_Adapter_Mysqli: /web/unisoft/web.system/Zend/Db/Adapter/Mysqli.php
Zend_Db_Profiler: /web/unisoft/web.system/Zend/Db/Profiler.php
Zend_Db_Statement_Interface: /web/unisoft/web.system/Zend/Db/Statement/Interface.php
Zend_Db_Statement: /web/unisoft/web.system/Zend/Db/Statement.php
Zend_Db_Statement_Mysqli: /web/unisoft/web.system/Zend/Db/Statement/Mysqli.php
Zend_Registry: /web/unisoft/web.system/Zend/Registry.php
Zend_Db_Table_Abstract: /web/unisoft/web.system/Zend/Db/Table/Abstract.php
Zend_Session_Abstract: /web/unisoft/web.system/Zend/Session/Abstract.php
Zend_Session: /web/unisoft/web.system/Zend/Session.php
Zend_Session_SaveHandler_Interface: /web/unisoft/web.system/Zend/Session/SaveHandler/Interface.php
Zend_Session_SaveHandler_DbTable: /web/unisoft/web.system/Zend/Session/SaveHandler/DbTable.php
Zend_Exception: /web/unisoft/web.system/Zend/Exception.php
Zend_Session_Exception: /web/unisoft/web.system/Zend/Session/Exception.php
Zend_Db_Select: /web/unisoft/web.system/Zend/Db/Select.php
Zend_Db_Table_Select: /web/unisoft/web.system/Zend/Db/Table/Select.php
Zend_Db_Expr: /web/unisoft/web.system/Zend/Db/Expr.php
Zend_Db_Table_Rowset_Abstract: /web/unisoft/web.system/Zend/Db/Table/Rowset/Abstract.php
Zend_Db_Table_Rowset: /web/unisoft/web.system/Zend/Db/Table/Rowset.php
Zend_Db_Table_Row_Abstract: /web/unisoft/web.system/Zend/Db/Table/Row/Abstract.php
Zend_Db_Table_Row: /web/unisoft/web.system/Zend/Db/Table/Row.php
HTTP: /web/unisoft/web.system/class/cls_http.inc.php
Zend_Session_Namespace: /web/unisoft/web.system/Zend/Session/Namespace.php
system_setting_class: /web/unisoft/web.core/system/setting.php
Zend_Cache: /web/unisoft/web.system/Zend/Cache.php
Zend_Cache_Backend: /web/unisoft/web.system/Zend/Cache/Backend.php
Zend_Cache_Backend_Interface: /web/unisoft/web.system/Zend/Cache/Backend/Interface.php
Zend_Cache_Backend_ExtendedInterface: /web/unisoft/web.system/Zend/Cache/Backend/ExtendedInterface.php
site_ip_class: /web/unisoft/web.core/site/ip.php
Zend_Validate_Interface: /web/unisoft/web.system/Zend/Validate/Interface.php
Zend_Validate: /web/unisoft/web.system/Zend/Validate.php
Zend_Loader: /web/unisoft/web.system/Zend/Loader.php
Zend_Validate_Abstract: /web/unisoft/web.system/Zend/Validate/Abstract.php
TPL: /web/unisoft/web.system/class/cls_template.inc.php
Savant3_Error: /web/unisoft/web.system/Savant3/Error.php
package_main_class: /web/unisoft/web.core/package/main.php
iot_hardware_main_class: /web/unisoft/web.core/iot/hardware/main.php
iot_hardware_category_class: /web/unisoft/web.core/iot/hardware/category.php
site_service_main_class: /web/unisoft/web.core/site/service/main.php
site_article_main_class: /web/unisoft/web.core/site/article/main.php
site_article_extra_class: /web/unisoft/web.core/site/article/extra.php
site_keyword_exclude_class: /web/unisoft/web.core/site/keyword/exclude.php
system_content_class: /web/unisoft/web.core/system/content.php
site_article_attachment_class: /web/unisoft/web.core/site/article/attachment.php
site_article_category_class: /web/unisoft/web.core/site/article/category.php
Database [main master]
[ Log time: 1787997674.1937 ] [ Expend time: 0.00543212890625 ] Connect DB
Cache
[ Log time: 1787997674.2067 ] Backend:
[ Log time: 1787997674.2073 ] [ Expend time: 0.000579 ] Get Cache: settings_ef8c7cef1f80fbad45b9ee480e92d03c, result type: array
[ Log time: 1787997674.2076 ] [ Expend time: 0.000247 ] Get Cache: crond, result type: boolean
[ Log time: 1787997674.2202 ] [ Expend time: 0.000714 ] Get Cache: model_7ec70ee0360b8a929eb442cbc38dfd27, result type: array
[ Log time: 1787997674.2237 ] [ Expend time: 0.002876 ] Get Cache: model_eebc36c56f6ebd5dc315368f04ea4f0d, result type: array
[ Log time: 1787997674.2249 ] [ Expend time: 0.000529 ] Get Cache: model_87644abf3b1d496cbf4b1667422d7d51, result type: array
[ Log time: 1787997674.2265 ] [ Expend time: 0.000622 ] Get Cache: site_service_list_7e49c82f3098f580fb5928807f5e466d, result type: array
[ Log time: 1787997674.2356 ] [ Expend time: 0.001783 ] Get Cache: site_keyword_exclude_b2c64c08a5048d87cc4904022274c118, result type: array
[ Log time: 1787997674.2467 ] [ Expend time: 0.001842 ] Get Cache: site_keyword_exclude_b2c64c08a5048d87cc4904022274c118, result type: array
[ Log time: 1787997674.2519 ] [ Expend time: 0.001757 ] Get Cache: site_keyword_exclude_b2c64c08a5048d87cc4904022274c118, result type: array
[ Log time: 1787997674.265 ] [ Expend time: 0.001710 ] Get Cache: site_keyword_exclude_b2c64c08a5048d87cc4904022274c118, result type: array
[ Log time: 1787997674.2762 ] [ Expend time: 0.000293 ] Get Cache: c3a125bceeb987f43c73c63e1447a896, result type: boolean
[ Log time: 1787997674.2793 ] [ Expend time: 0.001352 ] Save Cache: c3a125bceeb987f43c73c63e1447a896, result type: integer
Database [core master]
[ Log time: 1787997674.2116 ] [ Expend time: 0.0017828941345215 ] Connect DB
[ Log time: 1787997674.2125 ] [ Expend time: 0.0007479190826416 ] SELECT `z_ip`.* FROM `z_ip` WHERE (ip = '216.73.216' AND visit_time = 1787997660) LIMIT 1
[ Log time: 1787997674.2142 ] [ Expend time: 0.0016460418701172 ] UPDATE z_ip SET visit_count = visit_count + 1 WHERE ip = '216.73.216' and visit_time = 1787997660
[ Log time: 1787997674.2151 ] [ Expend time: 0.0008552074432373 ] DELETE FROM z_ip WHERE visit_count < 120 and visit_time <= 1787997480
[ Log time: 1787997674.2159 ] [ Expend time: 0.00069594383239746 ] SELECT SUM(visit_count) AS `n0` FROM `z_ip` WHERE ((ip = '216.73.216') AND is_delete = 0)
[ Log time: 1787997674.2313 ] [ Expend time: 0.0029671192169189 ] SELECT `z_article`.* FROM `z_article` WHERE (no = 'e12eb1b32ade01b7') LIMIT 1
[ Log time: 1787997674.2332 ] [ Expend time: 0.0010740756988525 ] SELECT `z_article_extra`.* FROM `z_article_extra` WHERE (is_delete = 0 AND article_id IN(5594))
[ Log time: 1787997674.25 ] [ Expend time: 0.00083494186401367 ] SELECT `z_article_extra`.* FROM `z_article_extra` WHERE (article_id = 5594) LIMIT 1
[ Log time: 1787997674.2618 ] [ Expend time: 0.0013358592987061 ] SELECT `z_article_attachment`.* FROM `z_article_attachment` WHERE (article_id = 5594 AND is_delete = 0) ORDER BY `id` DESC
[ Log time: 1787997674.2632 ] [ Expend time: 0.0012390613555908 ] SELECT `z_article`.* FROM `z_article` WHERE (is_delete = 0 AND category_id = 68 AND is_enable = 1) ORDER BY `id` DESC LIMIT 5
[ Log time: 1787997674.2779 ] [ Expend time: 0.0017180442810059 ] UPDATE z_article SET view_count = view_count + 1 WHERE id = 5594
[ Log time: 1787997674.2808 ] [ Expend time: 0.00074601173400879 ] SELECT `z_article_category`.* FROM `z_article_category` WHERE (id = 68) LIMIT 1
[ Log time: 1787997674.2817 ] [ Expend time: 0.0007171630859375 ] SELECT `z_article_category`.* FROM `z_article_category` WHERE (id = 30) LIMIT 1
Escape time: 0.10838508605957, 0 queries, PHP Memory usage: 5581.5625 KB, Server time: 2026-08-29 18:01:14