capacitor-vue

Implements Vue 3 Composition API patterns for Capacitor native app development.

1|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/involvex/ionic-everywhere --skill capacitor-vue-involvex
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: capacitor-vue
Source: https://github.com/involvex/ionic-everywhere/tree/main/.agents/skills/capacitor-vue
Command: npx skills add https://github.com/involvex/ionic-everywhere --skill capacitor-vue-involvex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Integrating Capacitor native plugins into a Vue 3 app requires framework-specific patterns for reactivity, lifecycle cleanup, routing, and meta-frameworks like Quasar and Nuxt, which are easy to get wrong and cause memory leaks or broken builds. ## Core Features & Use Cases - Composable Patterns: Wraps Capacitor plugins (Camera, Network, Geolocation) in reusable Vue composables with reactive state and automatic listener cleanup via onMounted/onUnmounted. - Router & Platform Integration: Handles deep links, Android back button behavior, and platform detection using Vue Router and Capacitor APIs. - Meta-Framework Guidance: Provides dedicated workflows for Quasar (boot files, src-capacitor structure) and Nuxt (ssr: false, .output/public webDir, client plugins). - Use Case: You have an existing Vue 3 + Vite app and want to ship it as an iOS/Android app with camera access, deep links, and correct back button behavior without leaking event listeners. ## Quick Start Add Capacitor to my Vue 3 project and create a composable that takes photos with the Camera plugin.

Frequently Asked Questions about capacitor-vue

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

FAQPage Schema
How do I use Capacitor plugins in a Vue 3 app?

Import the plugin and call it directly in a component using the Composition API, or wrap it in a composable for reusability. Composables encapsulate reactive state with ref and handle errors, making plugins like Camera and Geolocation easy to share across components.

How do I handle Capacitor event listeners in Vue without memory leaks?

Register plugin listeners in onMounted and remove them in onUnmounted by storing the PluginListenerHandle returned by addListener. Vue's reactivity picks up ref changes automatically, but failing to call handle.remove() on unmount causes memory leaks.

Can I use Capacitor with Nuxt?

Yes, but you must set ssr: false in nuxt.config.ts and build with npx nuxi generate to produce a static SPA. Set webDir to .output/public in the Capacitor config, and use .client.ts Nuxt plugins for Capacitor initialization.

How do I add Capacitor to a Quasar project?

Run quasar mode add capacitor instead of installing Capacitor manually. Quasar manages the native projects under src-capacitor/, and you use quasar dev -m capacitor or quasar build -m capacitor rather than npx cap commands.

Why is my Android back button closing the app unexpectedly?

The backButton listener must check the canGoBack property before calling App.exitApp(). If canGoBack is true, call router.back() to navigate history; only exit the app when there is no navigation history remaining.

Why are Capacitor plugin changes not appearing in my native app?

You must run npx cap sync after installing any new plugin and after rebuilding the web app. Also verify that webDir in capacitor.config.ts matches your Vue build output directory, which is dist for Vite projects.