Browse Source

Update 'README.md'

天问 1 year ago
parent
commit
365ffab993
1 changed files with 12 additions and 2 deletions
  1. 12 2
      README.md

+ 12 - 2
README.md

@@ -30,7 +30,7 @@ frontend.init(app)
 
 ```
 
-frontend.py
+**frontend.py**
 ```
 from fastapi import FastAPI
 
@@ -61,7 +61,17 @@ uvicorn main:app --reload --log-level debug --port 8000
 
 ## 源码分析
 
-当执行启动命令,调用 uvicorn 命令,启动一个 FastAPI 实例app,
+首先 nicegui 基于fastapi开发web。
+
+当执行启动命令,调用 uvicorn 命令,启动一个 FastAPI 实例app,在 frontend.py 中定义UI,但是python不需要编译,那怎么渲染页面呢?
+
+比如添加
+```
+ui.label('Hello, FastAPI!')
+```
+代码,如何在页面上生成一个div呢?
+
+