SuperAPI AI 工具集

wix-cli-dashboard-page

通用与其它

查看项目

更新于 10-15 22:32

技能介绍

用途:在 Wix CLI 应用中创建功能完整的仪表盘页面扩展,页面出现在站点所有者的仪表盘中,供管理员管理数据、配置设置和执行管理任务。

主要能力:通过 Wix Data SDK 进行数据读写,支持 query、filter、sort、limit、find 及 insert、update、remove,查询方法包括 eq、ne、gt、ge、lt、le、between、contains、startsWith、endsWith、hasSome、hasAll、isEmpty、isNotEmpty、and、or、not、ascending、descending、skip、include。Dashboard API 提供 navigate、observeState、showToast、openModal、navigateBack、getPageUrl、openMediaManager、onBeforeUnload、addSitePlugin、setPageTitle、onLayerStateChange 等方法。

使用方式:页面位于 src/extensions/dashboard/pages/<page-name>/,包含 page.tsx 与 extensions.ts。页面组件需用 WixDesignSystemProvider 包裹并导入 '@wix/design-system/styles.global.css'。extensions.ts 使用 extensions.dashboardPage() 注册,字段为 id(唯一静态 UUID v4)、title、routePath、component。之后必须在 src/extensions.ts 中导入并注册该扩展,否则页面不会显示。弹窗必须使用 dashboard 模态(dashboard.openModal()),不得使用 WDS Modal 或自定义 React 模态。配置嵌入式脚本时使用 @wix/app-management 的 embeddedScripts,参数以字符串存取。

适用场景:数据管理表格、设置表单、订单管理后台、嵌入式脚本配置页等。

限制:不得臆造类型、模块、函数、属性、事件或导入;不得使用 mock、占位符或 TODO;代码需在严格 TypeScript 设置下零错误编译,禁用 @ts-ignore 与 @ts-expect-error;布局基于 6px 单位与 12 列网格,内容区宽度 864–1248px。具体收费与价格暂未提供。