Skip to main content

Posts

Showing posts with the label npm

Setup a new Vue.js application with Vue CLI

Nowadays, Vue.js is one of the simplest and fast growing web frameworks available for the community. It's also pretty simple to start a new project with the Vue CLI tool. First, you will need to install it on your computer. Ensure you have npm installed and simply type the following in your terminal: npm install @vue/cli or, if you have yarn : yarn global add @vue/cli Now, please confirm you have it installed typing: vue -V Once you have properly installed the tool, the only thing you need to start a new Vue.js application is to choose a folder from your terminal and type the command: vue create your-app-name You will see the magic happening, follow the steps and now you have a basic Vue.js application ready to run and you can start coding to customize and improve your application. For more information, please visit the Vue CLI website:  https://cli.vuejs.org/ Want to see a live Vue.js application in production? Please visit and register the Dating web...

Building a API Client for VueJS

Hello! In this post i will show you how you could create a simple API Client service to use in your VueJS application so you could easily make HTTP Server calls from your app. First, make sure to install the Vue-resource module in your app using npm or yarn like: npm install vue-resource --save Then, import it into your main.js file, like below: Now, create a new file named api-client.js, put it in a directory called "services" and add the code: The code is self explaining and you can modify it as your needs. Now, you only need to use your ApiClient anywhere in your application. Below, i'm giving you a sample of using it in a Login component. Hope you enjoy!