Skip to content

daggerok/vue-ionic-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vue-ionic-example Build Status

How to start new Vue Ionic project

Project setup

npm i -g @vue/cli
vue create vue-ionic-example
cd vue-ionic-example
vue add router
npm i -E @ionic/core @ionic/vue

edit src/main.js file:

import '@ionic/core/css/ionic.bundle.css';
// import Ionic from '@ionic/vue';
import { defineCustomElements as Ionic } from "@ionic/core/loader"; // add a direct link to @ionic/core

Vue.use(Ionic);
Vue.config.ignoredElements = [/^ion-/];

finally use ionic in your root Aoo.vue component:

<template>
  <div class="ion-page">
    <ion-header>
      <ion-toolbar>
        <ion-title>My App</ion-title>
      </ion-toolbar>
    </ion-header>
    <ion-content class="ion-padding">
      <div>
        <router-link to="/">Home</router-link> |
        <router-link to="/about">About</router-link>
      </div>
      <router-view/>
    </ion-content>
  </div>
</template>

<script>
  export default {
    name: 'app',
  };
</script>

npm scripts

Compiles and hot-reloads for development

npm start

Compiles and minifies for production

npm run build

Run your unit tests

npm t

other repositories

resources