use-uniapp-dynamic-page-title

Compute and apply dynamic uni-app navigation bar titles from route parameters.

Updated Sep 11, 2025
One-click install
npx skills add https://github.com/ruan-cat/11comm-app --skill use-uniapp-dynamic-page-title
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: use-uniapp-dynamic-page-title
Source: https://github.com/ruan-cat/11comm-app/tree/main/.claude/skills/use-uniapp-dynamic-page-title
Command: npx skills add https://github.com/ruan-cat/11comm-app --skill use-uniapp-dynamic-page-title

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

uni-app 动态页面标题设置专家 - 根据路由参数或业务状态动态设置页面标题,使用 uni.setNavigationBarTitle API。

Core Features & Use Cases

  • 动态标题计算与应用:根据路由参数、业务状态或数据加载结果自动生成并设置页面标题,避免硬编码标题。
  • 跨场景适用:详情页、编辑页、审核页等需要根据状态显示不同标题的场景,以及从 Vue2 迁移的页面也能保持一致标题逻辑。
  • 数据源支持与协同技能:可与 route-migration、code-migration、api-migration 等技能协同,确保路由参数传递与接口数据对齐。

Quick Start

Use this skill to compute and apply a dynamic uni-app page title based on route action and status.

Frequently Asked Questions about use-uniapp-dynamic-page-title

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set a dynamic navigation bar title in uni-app based on route parameters?

To set a dynamic navigation bar title in uni-app, compute the title from route parameters or business state and apply it using the uni.setNavigationBarTitle API within the onReady lifecycle hook to ensure safe timing and rendering.

What is the best way to handle uni-app page titles during a Vue2 migration?

Handling uni-app page titles during a Vue2 migration involves resolving the title logic from route actions and applying it consistently across detail, edit, and audit pages to maintain state alignment without hard-coded titles.

Why does my dynamic uni-app title not update when the data loads from the API?

A dynamic uni-app title fails to update when data loads if uni.setNavigationBarTitle is called outside the onReady timing, which is required to safely apply titles computed from API loading results or business state.

Can I avoid hard-coded titles in uni-app detail and audit pages?

You can avoid hard-coded titles in uni-app detail and audit pages by computing the appropriate navigation bar title dynamically from route parameters, business state, or loading results, including fallback behavior for missing data.

Does uni-app support fallback behavior for dynamic page titles when route params are missing?

Uni-app supports fallback behavior for dynamic page titles by computing and applying an appropriate navigation bar title from available business state or loading results when route parameters are missing or incomplete.

What is the safe timing to call uni.setNavigationBarTitle for dynamic titles?

The safe timing to call uni.setNavigationBarTitle for dynamic titles is the onReady lifecycle hook, ensuring the navigation bar is fully rendered before applying the computed title from route parameters or API results.