Ionic Vueクイックスタート
Welcome! This guide will walk you through the basics of Ionic Vue development. You'll learn how to set up your development environment, generate a simple project, explore the project structure, and understand how Ionic components work. This is perfect for getting familiar with Ionic Vue before building your first real app.
If you're looking for a high-level overview of what Ionic Vue is and how it fits into the Vue ecosystem, see the Ionic Vue Overview.
Prerequisites
Before you begin, make sure you have Node.js and npm installed on your machine. You can check by running:
node -v
npm -v
If you don't have Node.js and npm, download Node.js here (which includes npm).
Create a Project with the Ionic CLI
First, install the latest Ionic CLI:
npm install -g @ionic/cli
Then, run the following commands to create and run a new project:
ionic start myApp blank --type vue
cd myApp
ionic serve
After running ionic serve, your project will open in the browser.

Explore the Project Structure
Your new app's src directory will look like this:
├── App.vue
├── main.ts
├── router
│ └── index.ts
└── views
└── HomePage.vue
All file paths in the examples below are relative to the src/ directory.
Let's walk through these files to understand the app's structure.
View the App Component
The root of your app is defined in App.vue:
<template>
<ion-app>
<ion-router-outlet />
</ion-app>
</template>
<script setup lang="ts">
import { IonApp, IonRouterOutlet } from '@ionic/vue';
</script>
This sets up the root of your application, using Ionic's ion-app and ion-router-outlet components. The router outlet is where your pages will be displayed.
View Routes
Routes are defined in router/index.ts:
import { createRouter, createWebHistory } from '@ionic/vue-router';
import { RouteRecordRaw } from 'vue-router';
import HomePage from '../views/HomePage.vue';
const routes: Array<RouteRecordRaw> = [
{
path: '/',
redirect: '/home',
},
{
path: '/home',
name: 'Home',
component: HomePage,
},
];
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes,
});
export default router;
When you visit the root URL (/), the HomePage component will be loaded.
View the Home Page
The Home page component, defined in views/HomePage.vue, imports the Ionic components and defines the page template:
<template>
<ion-page>
<ion-header :translucent="true">
<ion-toolbar>
<ion-title>Blank</ion-title>
</ion-toolbar>
</ion-header>
<ion-content :fullscreen="true">
<ion-header collapse="condense">
<ion-toolbar>
<ion-title size="large">Blank</ion-title>
</ion-toolbar>
</ion-header>
<div id="container">
<strong>Ready to create an app?</strong>
<p>
Start with Ionic
<a target="_blank" rel="noopener noreferrer" href="https://ionicframework.com/docs/components"
>UI Components</a
>
</p>
</div>
</ion-content>
</ion-page>
</template>
<script setup lang="ts">
import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/vue';
</script>
<!-- ...styles... -->