自定义展示页面适合看板、门户、可视化报告、计算器和富交互页面。OpenYida 会把符合宜搭运行时规范的 JSX 编译并发布到对应页面容器。Documentation Index
Fetch the complete documentation index at: https://openyida.ai/docs/llms.txt
Use this file to discover all available pages before exploring further.
端到端流程
create-page 会返回页面的 formUuid。不要手写或猜测这个值,应保存命令输出,或从项目缓存里读取。
运行时规范
宜搭自定义页面运行在 React 16 类组件模式下,源码需遵守这些规则:- 使用
export function renderJsx()输出页面。 - 使用
export function didMount()和export function didUnmount()处理生命周期。 - 自定义方法写成
export function methodName() {}。 - 事件处理要包一层函数,例如
onClick={(e) => { this.handleClick(e); }}。 .map()、.filter()等回调使用箭头函数。- 不使用
useState、useEffect等 React Hooks。 - 页面源码中不使用
import和require。 - 样式使用内联 style 对象。
- 输入框优先使用
defaultValue。
发布前检查
check-page 会检查常见运行时错误。compile 会在 project/pages/build/ 和 project/pages/dist/ 下生成兼容宜搭的产物。
隐藏宜搭导航
全屏看板或演示页通常需要隐藏平台导航:何时使用 build-page
build-page 只转换源码,不发布页面。它适合做代码审查、CI 检查或调试编译输出。