Close Menu
Soshace Digital Blog

    Subscribe to Updates

    Get The Latest News, Updates, And Amazing Offers

    What's Hot
    Entrepreneurs

    Our strength Proper Business in your Path

    Interview

    Interview with Anuar Akhmetov: I Was Apathetic of Programming until I Met My Very Best Mentor

    JavaScript

    Top React JS Interview Questions

    Important Pages:
    • Home
    • About
    • Services
    • Contact Us
    • Privacy Policy
    • Terms & Conditions
    Facebook X (Twitter) Instagram LinkedIn YouTube
    Today's Picks:
    • Scaling Success: Monitoring Indexation of Programmatic SEO Content
    • Leveraging Influencers: Key Drivers in New Product Launches
    • How Privacy-First Marketing Will Transform the Industry Landscape
    • The Impact of Social Proof on Thought Leadership Marketing
    • Balancing Value-Driven Content and Promotional Messaging Strategies
    • Top Influencer Marketing Platforms to Explore in 2025
    • Emerging Trends in Marketing Automation and AI Tools for 2023
    • Strategies to Mitigate Duplicate Content in Programmatic SEO
    Wednesday, September 10
    Facebook X (Twitter) Instagram LinkedIn YouTube
    Soshace Digital Blog
    • Home
    • About
    • Services
    • Contact Us
    • Privacy Policy
    • Terms & Conditions
    Services
    • SaaS & Tech

      Maximizing Efficiency: How SaaS Lowers IT Infrastructure Costs

      August 27, 2025

      Navigating Tomorrow: Innovations Shaping the Future of SaaS

      August 27, 2025

      Maximizing Impact: Strategies for SaaS & Technology Marketing

      August 27, 2025
    • AI & Automation

      Enhancing Customer Feedback Analysis Through AI Innovations

      August 27, 2025

      Navigating the Impact of AI on SEO and Search Rankings

      August 27, 2025

      5 Automation Hacks Every Home Service Business Needs to Know

      May 3, 2025
    • Finance & Fintech

      Critical Missteps in Finance Marketing: What to Avoid

      August 27, 2025

      Analyzing Future Fintech Marketing Trends: Insights Ahead

      August 27, 2025

      Navigating the Complex Landscape of Finance and Fintech Marketing

      August 27, 2025
    • Legal & Compliance

      Exploring Thought Leadership’s Impact on Legal Marketing

      August 27, 2025

      Maximizing LinkedIn: Strategies for Legal and Compliance Marketing

      August 27, 2025

      Why Transparency Matters in Legal Advertising Practices

      August 27, 2025
    • Medical Marketing

      Enhancing Online Reputation Management in Hospitals: A Guide

      August 27, 2025

      Analyzing Emerging Trends in Health and Medical Marketing

      August 27, 2025

      Exploring Innovative Content Ideas for Wellness Blogs and Clinics

      August 27, 2025
    • E-commerce & Retail

      Strategic Seasonal Campaign Concepts for Online and Retail Markets

      August 27, 2025

      Emerging Trends in E-commerce and Retail Marketing Strategies

      August 27, 2025

      Maximizing Revenue: The Advantages of Affiliate Marketing for E-Commerce

      August 27, 2025
    • Influencer & Community

      Leveraging Influencers: Key Drivers in New Product Launches

      August 27, 2025

      Top Influencer Marketing Platforms to Explore in 2025

      August 27, 2025

      Key Strategies for Successful Influencer Partnership Negotiations

      August 27, 2025
    • Content & Leadership

      The Impact of Social Proof on Thought Leadership Marketing

      August 27, 2025

      Balancing Value-Driven Content and Promotional Messaging Strategies

      August 27, 2025

      Analyzing Storytelling’s Impact on Content Marketing Effectiveness

      August 27, 2025
    • SEO & Analytics

      Scaling Success: Monitoring Indexation of Programmatic SEO Content

      August 27, 2025

      Strategies to Mitigate Duplicate Content in Programmatic SEO

      August 27, 2025

      Effective Data Visualization Techniques for SEO Reporting

      August 27, 2025
    • Marketing Trends

      How Privacy-First Marketing Will Transform the Industry Landscape

      August 27, 2025

      Emerging Trends in Marketing Automation and AI Tools for 2023

      August 27, 2025

      Maximizing ROI: Key Trends in Paid Social Advertising

      August 27, 2025
    Soshace Digital Blog
    Blog / JavaScript / Vue / Building Mobile Apps With Vue3 and Ionic
    JavaScript

    Building Mobile Apps With Vue3 and Ionic

    Oluwaseun RaphaelBy Oluwaseun RaphaelNovember 11, 2020Updated:November 11, 2020No Comments7 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr Email Reddit
    Building Mobile Apps With Vue3 and Ionic
    Building Mobile Apps With Vue3 and Ionic
    Share
    Facebook Twitter LinkedIn Pinterest Email Copy Link
    Building Mobile Apps With Vue3 and Ionic
    Building Mobile Apps With Vue3 and Ionic

    Introduction

    Ionic is an open-source UI framework and toolkit that helps developers build highly efficient and performant apps for native iOS, Android, and the web (PWA). On October 15th, 2020, the Ionic team announced the official release of Ionic-vue, a new way of building applications using the two technologies you already love: Ionic and Vuejs. In this tutorial, we are going to be creating a simple application (shown below) to demonstrate the basics of how ionic-vue works.

    Simple Ionic-vue application
    Simple Ionic-vue application

    Requirements

    This tutorial assumes you have at least a little experience with Vuejs and the Ionic framework and that you have the following setup on your computer. If you don’t, head over to their respective download pages to set them up.

    • NodeJs and NPM: Download here
    • A text editor – eg VSCode, Atom, etc
    • Android Studio: Download for Windows, Linux, and Mac users here.
    • X-Code: Download for Mac users here

    Setting Up The Development Environment

    Verify you have NPM and NodeJs installed on your computer by running

    npm -v

    If NPM is installed, you should get a response similar to the screenshot below. If you get a command not found error, you may need to reinstall NPM.

    The output of running npm -v
    The output of running npm -v

    Once you verify the Node Package Manager (NPM) is installed, Open up a terminal and install the ionic CLI  globally on your computer by running the command below:

    npm install -g @ionic/cli

    Creating Our Ionic Vue Project

    Ionic provides starter files to make development less stressful. The ionic starter app has different options namely

    • tabs: a boilerplate preconfigured with a bottom tabbed navigation system
    • side-menu: a boilerplate that comes shipped with a side menu navigation system
    • blank: A simple boilerplate with no extra features

    In this tutorial, we will make use of the blank template as we do not need other features.  Run the following command to generate a blank starter project in any directory of your choice eg: /desktop.

    ionic start ionic-vue-demo-app blank --type vue

    Once the starter app has been generated successfully, run the ionic serve command and head over to http://localhost:8100 to preview your project in the browser. Next, open the ‘ionic-vue-demo-app’ folder in your preferred editor eg VS Code, and let’s begin creating our demo ionic vue app!

    Ionic-vue folder structure
    Ionic-vue folder structure

    Adding Mobile Platforms Support

    To make your application available on mobile devices, run either or both of the following to enable support.

    ionic cap add ios # to enable support for ios devices
    
    ionic cap add android # to enable support for android devices

    Debugging on iOS

    If you’re a mac user and you want to preview your application in an ios simulator, ensure you have a recent version of x-code installed, then run the following commands to enable iOS support, run a production build of the app, and then open the project for debugging in x-code respectively.

    ionic cap add ios 
    ionic run build 
    npx cap open ios

    In x-code, click on the run button to launch the app in your preferred simulator.

    Read More:  Introduction to Vue.js Event Handling
    Previewing your Ionic Vue app in X-code
    Previewing your Ionic Vue app in X-code

    Debugging on Android

    Similarly, to enable debugging for android, run the following commands to set up the required Gradle files and open in android studio.

    ionic cap add android
    ionic run build
    npx cap open android

    Once the project has been opened in android studio, click on the run icon to launch the app in an emulator of your choice.

    Previewing your Ionic Vue app in Android studio
    Previewing your Ionic Vue app in Android studio

    A simple Demo

    Creating Markup

    Components in Ionic-vue has pretty much the same syntax as in ionic,  hence, you should have no trouble if you are familiar with ionic already. The only difference is that you would need to import each component from ionic/vue inside your <script> </script> later. To learn more about components and tags available in ionic Vue, visit the official documentation here. Open the Home.vue file and add the following markup

    <template>
      <ion-page>
        <ion-header :translucent="true">
          <ion-toolbar>
            <ion-title>Demo Application</ion-title>
          </ion-toolbar>
        </ion-header>
    
        <ion-content :fullscreen="true">
          <ion-header collapse="condense">
            <ion-toolbar>
              <ion-title size="small">Demo Application</ion-title>
            </ion-toolbar>
          </ion-header>
    
          <div
            id="container"
            v-bind:class="{ 'top-margin': !users, usersShowing: users }"
          >
            <ion-button v-show="!users" @click="loadUsers()" expand="block"
              >View All Users</ion-button
            >
            <strong v-show="users"> All Users</strong>
            <ion-list>
              <!-- Loops through the users array -->
              <ion-item v-for="user in users" v-bind:key="user.id"> 
                <ion-label>{{ user.name }} </ion-label>
              </ion-item>
            </ion-list>
            <ion-button v-show="users" @click="users = null" color="danger"
              >Hide Users</ion-button
            >
          </div>
        </ion-content>
      </ion-page>
    </template>

    Adding Logic and Making API calls

    To add Javascript logic to our application, we make use of script tags just as in a typical Vuejs file. this script tag is where functions and data relating to our application will be stored. We need to make an HTTP GET request to https://jsonplaceholder.typicode.com/users to get a JSON array of Dummy user data. We will use Axios to make the call but feel free to use any client of your choice.

    Read More:  5 Best JavaScript Conferences to Attend in 2019

    To install Axios, run:

    npm install axios --save
    

    Next, import it into the project along with any other utility you need. Next, Let’s add the  following Javascript logic to make API calls to the mock JSON server as such:

    <script lang="ts">
    import {
      IonContent,
      IonHeader,
      IonPage,
      IonTitle,
      IonToolbar,
    } from "@ionic/vue";
    import { defineComponent } from "vue";
    import axios from "axios";
    
    export default defineComponent({
      name: "Home",
      components: {
        IonContent,
        IonHeader,
        IonPage,
        IonTitle,
        IonToolbar,
      },
      data() {
        return { users: null }; // sets users to null on instantiation
      },
      methods: {
        loadUsers() {
          axios
            .get("https://jsonplaceholder.typicode.com/users")
            .then((response) => {
              this.users = response.data; // assigns the data from api call to the users variable
            });
        },
      },
    });
    </script>
    

    Adding Styling

    To add styling to our view, create a regular <style> </style> tag and add the following stylesheets to give our app page a better look:

    <style scoped>
    #container {
      text-align: center;
      position: absolute;
      left: 0;
      right: 0;
    
      transform: translateY(-50%);
    }
    .top-margin {
      top: 20%;
    }
    .usersShowing {
      margin-top: 70%;
    }
    </style>

    In the end, the Home.vue file should look like this.

    <template>
      <ion-page>
        <ion-header :translucent="true">
          <ion-toolbar>
            <ion-title>Demo Application</ion-title>
          </ion-toolbar>
        </ion-header>
        
        <ion-content :fullscreen="true">
          <ion-header collapse="condense">
            <ion-toolbar>
              <ion-title size="small">Demo Application</ion-title>
            </ion-toolbar>
          </ion-header>
        
          <div id="container" v-bind:class="{ 'top-margin': !users, 'usersShowing': users }">
         
              <ion-button v-show="!users" @click="loadUsers()" expand="block">View All Users</ion-button>
              <strong v-show="users"> All Users</strong>
        <ion-list>
          <ion-item v-for="user in users" v-bind:key="user.id">
            <ion-label>{{user.name}} </ion-label>
          </ion-item>
        </ion-list>
      <ion-button v-show="users" @click="users = null" color="danger">Hide Users</ion-button>
          </div>
        </ion-content>
      </ion-page>
    </template>
    
    <script lang="ts">
    import { IonContent, IonHeader, IonPage, IonTitle, IonToolbar } from '@ionic/vue';
    import { defineComponent } from 'vue';
    import axios from 'axios';
    
    export default defineComponent({
      name: 'Home',
      components: {
        IonContent,
        IonHeader,
        IonPage,
        IonTitle,
        IonToolbar
      },
      data(){
        return {users : null} // sets users to null on instantiation
      },
      methods: {
    loadUsers(){axios.get('https://jsonplaceholder.typicode.com/users').then(
        response => {
          this.users = response.data // assigns the data from api call to the users variable 
        }) 
        }
      },
      
      }
    )
    </script>
    
    <style scoped>
    #container {
      text-align: center;
      position: absolute;
      left: 0;
      right: 0;
     
      transform: translateY(-50%);
    } 
    .top-margin{
     top: 20%;
    }
    .usersShowing{
      margin-top:70%;
    }
    
    </style>

    Syncing Changes

    Once you’re ready to see your changes deployed to its specific mobile platforms, run the npx cap copy command to sync your changes to ios and android and run a fresh preview of your application. The end result of the app should look like this on ios:

     Screenshot of app preview
    Screenshot of app preview

    Conclusion

    What’s your favorite thing about Ionic Vue? do reach out in the comment section below if you have any questions or suggestions, I cant wait to see what you build with this awesome framework 🙂

    You can view the full source code of the project on Github here

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Oluwaseun Raphael

      Related Posts

      Streamlining Resource Allocation for Enhanced Project Success

      December 18, 2024

      Conducting Effective Post-Project Evaluations: A Guide

      December 16, 2024

      Strategies for Keeping Projects on Track and Meeting Deadlines

      December 10, 2024
      Leave A Reply Cancel Reply

      You must be logged in to post a comment.

      Stay In Touch
      • Facebook
      • Twitter
      • Pinterest
      • Instagram
      • YouTube
      • Vimeo
      Don't Miss
      Startups October 4, 2016

      14. Node.js Lessons. Script Debugging pt. 2

      Let’s continue our debug lesson. Let us learn another essential debugging scenario, in particular – debugging with errors in JavaScript. For example, while handling a request:

      5 Tips from Famous Entrepreneurs to Instantly Boost Your Productivity

      February 28, 2019

      Introduction to WebAssembly: The Magic of Native Code in Web Apps

      August 5, 2019

      How Google, Apple, and Other Tech Companies Organize Their Remote Teams

      April 10, 2019

      Categories

      • AI & Automation
      • Angular
      • ASP.NET
      • AWS
      • B2B Leads
      • Beginners
      • Blogs
      • Business Growth
      • Case Studies
      • Comics
      • Consultation
      • Content & Leadership
      • CSS
      • Development
      • Django
      • E-commerce & Retail
      • Entrepreneurs
      • Entrepreneurship
      • Events
      • Express.js
      • Facebook Ads
      • Finance & Fintech
      • Flask
      • Flutter
      • Franchising
      • Funnel Strategy
      • Git
      • GraphQL
      • Home Services Marketing
      • Influencer & Community
      • Interview
      • Java
      • Java Spring
      • JavaScript
      • Job
      • Laravel
      • Lead Generation
      • Legal & Compliance
      • LinkedIn
      • Machine Learning
      • Marketing Trends
      • Medical Marketing
      • MSP Lead Generation
      • MSP Marketing
      • NestJS
      • Next.js
      • Node.js
      • Node.js Lessons
      • Paid Advertising
      • PHP
      • Podcasts
      • POS Tutorial
      • Programming
      • Programming
      • Python
      • React
      • React Lessons
      • React Native
      • React Native Lessons
      • Recruitment
      • Remote Job
      • SaaS & Tech
      • SEO & Analytics
      • Soshace
      • Startups
      • Swarm Intelligence
      • Tips
      • Trends
      • Vue
      • Wiki
      • WordPress
      Top Posts

      Analyzing LinkedIn Automation’s Impact on Lead Generation

      LinkedIn November 24, 2024

      Leveraging Lean Startup Methodology for Business Growth Success

      Startups December 1, 2024

      How to create a Github Jobs app using React, Apollo, and GraphQL – Part #2

      GraphQL October 26, 2020

      JSON WEB Authentication with Angular 8 and NodeJS

      JavaScript October 4, 2019

      Subscribe to Updates

      Get The Latest News, Updates, And Amazing Offers

      About Us
      About Us

      Soshace Digital delivers comprehensive web design and development solutions tailored to your business objectives. Your website will be meticulously designed and developed by our team of seasoned professionals, who combine creative expertise with technical excellence to transform your vision into a high-impact, user-centric digital experience that elevates your brand and drives measurable results.

      7901 4th St N, Suite 28690
      Saint Petersburg, FL 33702-4305
      Phone: 1(877)SOSHACE

      Facebook X (Twitter) Instagram Pinterest YouTube LinkedIn
      Our Picks
      Programming

      Уроки React. Урок 11. Pt.2.

      Beginners

      Web Usability Essentials

      JavaScript

      Fames Acturpis Egestas Sed Tempus Etpharetra Pharetra

      Most Popular

      Building a Realtime Messaging app with React Native and Firebase

      React Native

      Tim&Tom JavaScript Frameworks

      Comics

      Balancing Enthusiasm: Effective Interview Strategies

      Interview
      © 2025 Soshace Digital.
      • Home
      • About
      • Services
      • Contact Us
      • Privacy Policy
      • Terms & Conditions

      Type above and press Enter to search. Press Esc to cancel.