Skill 详情

ionic-app-development

Directly supports cross-platform app development with Ionic.

匹配类型直接匹配已针对 应用开发 审核
来源capawesome-team/skills外部来源
报告安装量603仅表示受欢迎程度

使用前先检查

自动化审核只检查相关性,不代表安全审查或推荐。使用前请阅读来源中的说明。

已保存的来源预览

SKILL.md

这段内容是审核时保存的快照。外部来源才是完整且最新的版本。

---
name: ionic-app-development
description: "Guides the agent through general Ionic Framework development including core concepts, component reference, CLI usage, layout, theming, animations, gestures, development workflow, and troubleshooting. Covers all Ionic UI components grouped by category with properties, events, methods, slots, and CSS custom properties. Do not use for creating a new Ionic app (use ionic-app-creation), framework-specific patterns (use ionic-angular, ionic-react, ionic-vue), or upgrading Ionic versions (use ionic-app-upgrades)."
metadata:
  author: capawesome-team
  source: https://github.com/capawesome-team/skills/tree/main/skills/ionic-app-development
---

# Ionic App Development

General Ionic Framework development — core concepts, component reference, CLI usage, layout, theming, utilities, development workflow, and troubleshooting.

## Prerequisites

1. **Node.js** (latest LTS) installed.
2. **Ionic CLI** installed globally (`npm install -g @ionic/cli`).
3. An existing Ionic project. For creating a new Ionic app, use the **`ionic-app-creation`** skill.

## Agent Behavior

- **Auto-detect the framework.** Check `package.json` for `@ionic/angular`, `@ionic/react`, or `@ionic/vue` to determine the framework in use. Adapt code examples accordingly.
- **Route to reference files.** This skill is an overview that routes agents to specific reference files for detailed component APIs and topic-specific guidance.
- **Do not duplicate framework-specific skills.** For Angular, React, or Vue specific patterns, refer to the respective framework skill.

## Core Concepts

### How Ionic Works

Ionic Framework is a UI toolkit for building cross-platform apps using web technologies (HTML, CSS, JavaScript/TypeScript). It provides a library of pre-built UI components that adapt their styling to the platform (`ios` or `md` mode).

- **Components** are custom HTML elements (Web Components) prefixed with `ion-` (e.g., `<ion-button>`, `<ion-content>`).
- **Platform modes**: Ionic renders components differently based on the platform. iOS devices use the `ios` mode; Android and all other platforms use the `md` (Material Design) mode. The `<html>` element receives a class (`ios` or `md`) that enables platform-specific styles.
- **Capacitor integration**: Ionic apps use Capacitor to access native device features. Ionic handles the UI; Capacitor handles native APIs. See the **`capacitor-app-development`** skill for Capacitor-specific guidance.

### Page Lifecycle

Ionic provides lifecycle events on top of the framework's own lifecycle hooks. These fire when a page is navigated to or from:

| Event                 | Description                                                |
| --------------------- | ---------------------------------------------------------- |
| `ionViewWillEnter`    | Fires when the page is about to enter and become active.   |
| `ionViewDidEnter`     | Fires when the page has fully entered and is now active.   |
| `ionViewWillLeave`    | Fires when the page is about to leave and become inactive. |
| `ionViewDidLeave`     | Fires when the page has fully left and is now inactive.    |

These are in addition to the framework-specific lifecycle hooks (e.g., Angular's `ngOnInit`, React's `useEffect`, Vue's `onMounted`). Use Ionic lifecycle events for tasks that should run each time a page becomes visible (e.g., refreshing data), since some navigation strategies cache pages.

## Component Reference

Ionic provides 80+ UI components. Detailed API documentation for each component is organized into reference files by category. Each reference file covers properties, events, methods, slots, CSS shadow parts, and CSS custom properties.

When the user needs help with a specific component, read the corresponding reference file.

| Category         | Reference File                            | Components Covered                                                                                              |
| ---------------- 
在 GitHub 阅读完整来源 (打开外部页面)
相关上下文

相关工作