Skip to content

guanshiyin28/Vue-Calculator

Vue Calculator

This repository serves as a foundation for building a user-friendly calculator application utilizing the Vue.js framework for efficient and reactive front-end development.



Purpose of This Repository

This repository contains the source code for a basic calculator application built with Vue.js. The project demonstrates fundamental front-end development principles and provides a solid foundation for further exploration of Vue.js capabilities.



Demo

Check out the live demo of the Vue Calculator here.

Program Function Demonstration

Here is a demonstration of the basic arithmetic operations provided by the calculator:

// filepath: /home/guan/Documents/Code/Vue-Calculator/src/components/Calculator.vue
methods: {
  add(a, b) {
    return a + b;
  },
  subtract(a, b) {
    return a - b;
  },
  multiply(a, b) {
    return a * b;
  },
  divide(a, b) {
    if (b === 0) {
      return 'Error: Division by zero';
    }
    return a / b;
  }
}


Features

  • Basic arithmetic operations (addition, subtraction, multiplication, division)
  • Responsive design
  • Clear and user-friendly interface
  • Real-time calculation updates


Technologies Used

  • Vue.js
  • HTML5
  • CSS3
  • JavaScript


Project Setup

  1. Install Node.js
  2. Clone this repository
git clone https://github.com/guanshiyin28/Vue-Calculator.git
  1. Direct to directory
cd Vue-Calculator
  1. Install npm
npm install


Steps to Run

  1. Compiles and hot-reloads for development
npm run serve
  1. Compiles and minifies for production
npm run build
  1. Lints and fixes files
npm run lint


License

This project is licensed under the Apache-2.0 License. See the LICENSE file for details.