Skip to content
On this page
🔥 Join our campaign to train 350 million activists!

Week 5: Building components (Javascript & Vue)

Last update: Sep 29, 2021
Languages:

During this session, you will learn how to build components in Vue to avoid writing repetative code.

Session details

This session takes place on the 7th of Nov 14:00 UTC.

  • ☎️ Video call
  • 📝 Minutes
  • 🔴 Recording: Will be made available after the session.

Installations

This week, you will use the Vue CLI to create a new Vue project. First, you will need to install the Vue CLI globally.

Installing something globally, means that you do not just install it inside a certain directory, for example your project folder, but make it available on your entire computer.

In the following steps, we assume you already have Yarn installed:

  • Step 1: Install the Vue CLI globally using this command:
    yarn global add @vue/cli.
  • Step 2: Navigate to the right folder in your terminal and run the following command to create a new project:
    vue create my-project.
  • Step 3: To start a development server, run the following command inside your project directory:
    vue serve

Alternatively, you can use the graphical user interface to create a new project. Start the GUI with this command: vue ui

Group project

For next week, prepare the following together with your fellow students:

  • Turn all the guides that you created during previous sessions into a Vue project. Use Vue components to reuse pieces of code, such as a navigation bar.
  • Add a way for users to bookmark articles and make a page that shows all bookmarked articles. For now, you will not be able to save their bookmarks when the user reloads the page. During the last session, we will explain how to save user data on a server.
  • Share all of this in our GitHub repository.
  • Prepare a short presentation to share your work at next week’s workshop.

We have not created a full example project for this week. However, we have added some instructions on how to easily set up a Vue project using the Vue CLI

Resources

We're building the Wikipedia for activists

And you can help us. Join our our international team, or start a local group of writers.

Creative Commons Attribution-NonCommercial-ShareAlike logo
You can reuse this content!
Just make sure to give attribution to Activist Handbook and read our licence for the details. Want to use our logo? Read our design guide.
All our work is available under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Licence, unless otherwise noted.
Improve this page!