Loading...
Loading...
Skyline 小程序 JSON 配置规范技能。涵盖 app.json 全局配置(renderer、rendererOptions、componentFramework)、页面 json 配置(navigationStyle、disableScroll)、project.config.json 项目配置。适用于创建新 Skyline 项目、迁移 WebView 项目、配置混合渲染。触发关键词:app.json、页面配置、renderer、rendererOptions、skyline配置、navigationStyle、disableScroll、componentFramework、glass-easel、project.config.json。
npx skill4agent add wechat-miniprogram/skyline-skills skyline-config| 层级 | 文件 | 作用 | 关键配置 |
|---|---|---|---|
| 全局 | | 全局启用 Skyline | renderer, componentFramework, rendererOptions |
| 页面 | | 页面级配置/覆盖 | navigationStyle, disableScroll, renderer |
| 工具 | | 开发者工具调试 | setting.skylineRenderEnable |
// app.json
{
"renderer": "skyline",
"componentFramework": "glass-easel",
"lazyCodeLoading": "requiredComponents"
}// 每个页面的 .json
{
"navigationStyle": "custom"
}references/| 我想要... | 查阅文档 |
|---|---|
| 了解 app.json 中所有 Skyline 相关配置 | |
| 了解页面级配置和混合渲染 | |
| 配置开发者工具 | |
| 查看完整配置模板 | |
// ❌ 错误:缺少 componentFramework 和 lazyCodeLoading
{
"pages": ["pages/index/index"],
"renderer": "skyline"
}
// ✅ 正确:三项缺一不可
{
"renderer": "skyline",
"componentFramework": "glass-easel",
"lazyCodeLoading": "requiredComponents"
}"navigationStyle": "custom"// ❌ 错误:缺少 navigationStyle,编译报错
// getAppConfig error: the "navigationStyle" configuration
// for the page should be set to "custom"
{
"usingComponents": {}
}
// ✅ 正确
{
"navigationStyle": "custom"
}"disableScroll": true// ❌ 错误:未禁用页面滚动,可能与 scroll-view 冲突
{
"navigationStyle": "custom"
}
// ✅ 正确:禁用页面滚动,使用 scroll-view 管理滚动
{
"navigationStyle": "custom",
"disableScroll": true
}// ❌ 错误:未配置 rendererOptions,Skyline 默认 display:flex + border-box
{
"renderer": "skyline"
}
// ✅ 正确:对齐 WebView 的 block + content-box 默认行为
{
"renderer": "skyline",
"rendererOptions": {
"skyline": {
"defaultDisplayBlock": true,
"defaultContentBox": true
}
}
}navigationStyle: "custom"scroll-view| 配置项 | 位置 | 值 | 级别 |
|---|---|---|---|
| app.json | | 必需 |
| app.json | | 必需 |
| app.json | | 必需 |
| 页面 json | | 必需 |
| 页面 json | | 推荐 |
| 配置项 | 类型 | 默认值 | 推荐值 | 说明 |
|---|---|---|---|---|
| boolean | false | true | 默认 display:block(对齐 WebView) |
| boolean | false | true | 默认 box-sizing:content-box(对齐 WebView) |
| string | "isolated" | "legacy" | 标签选择器全局匹配(对齐 WebView) |
| boolean | false | true | scroll-view 自动撑开高度 |
| boolean | false | true | 关闭 Skyline AB 实验,确保稳定性 |
| 场景 | 推荐配置 |
|---|---|
| 新建 Skyline 项目 | 三项必需 + rendererOptions 全部推荐值 |
| WebView 迁移 | 三项必需 + rendererOptions 兼容配置 + disableABTest |
| 混合渲染 | app.json 不设 renderer,页面级单独设 |
| 仅部分页面用 Skyline | 页面 json 中设 |
| 场景 | 推荐技能 | 说明 |
|---|---|---|
| WXSS 样式兼容 | | rendererOptions 影响的默认值详解(display/flex-direction/align-items/box-sizing) |
| glass-easel 框架 | | componentFramework 详细迁移指南 |
| Skyline 概览与迁移 | | 渲染引擎概览、迁移步骤 |
| 组件使用 | | scroll-view 等组件配置 |
| 路由配置 | | 自定义路由与页面转场 |
references/
├── app-config.md
├── page-config.md
├── patterns.md
└── project-config.md