Install the vue/cli

Share this video with your friends

Social Share Links

Send Tweet
Published 3 years ago
Updated a year ago

We'll see how to install the vue/cli and how to start a project using it. We'll discuss the boilerplate that is provided by this bootstrapping process.

Instructor: [0:00] One way that we have built this application is fine for us learning Vue, it's not the way we will generally build. We use the Vue CLI, or command-line interface, and the build tools that come along with that. How do we do that?

[0:14] I'm going to, npm install -g, for globally, @vue/cli. Once that's finished, I'll do, vue --version, to make sure I have it installed. We can see I do, and now, I'm going to create. I'm going to do, vue create TicketApp. We want to use Vue 3, so we'll go down and we'll select Vue 3, and we can see this TicketApp folder.

[0:46] This folder is now quite full. We have a public folder, which has got an index.html file, which is where our Vue application will be mounted on, much like we did in our example application. We have a source directory, which has a main.js file, much like we've had before, but it's importing from this new file, this app.vue.

[1:09] In this .vue file, there are three parts to it. There's the template, which is the html that makes up our Vue file. There's the script, which is the JavaScript that might make up the logic to our component. There's the style, which is the CSS that we'll make it up. Each component can also be a Vue file. We'll also have template, scripts, and styles.

[1:36] A scoped property like this means that the CSS in here is only going to apply to the component. It won't apply globally. Even though I'm using h3 here, that h3 styling will only apply to the h3 that is in this component. It won't apply anywhere else.

egghead
egghead
~ 18 minutes ago

Member comments are a way for members to communicate, interact, and ask questions about a lesson.

The instructor or someone from the community might respond to your question Here are a few basic guidelines to commenting on egghead.io

Be on-Topic

Comments are for discussing a lesson. If you're having a general issue with the website functionality, please contact us at support@egghead.io.

Avoid meta-discussion

  • This was great!
  • This was horrible!
  • I didn't like this because it didn't match my skill level.
  • +1 It will likely be deleted as spam.

Code Problems?

Should be accompanied by code! Codesandbox or Stackblitz provide a way to share code and discuss it in context

Details and Context

Vague question? Vague answer. Any details and context you can provide will lure more interesting answers!

Markdown supported.
Become a member to join the discussionEnroll Today