Create vue2 project detailed steps and error solutions from 0 to 1

1. Steps to create a vue2 project:

1. Check the node environment

node -v

2. Create a project name

vue create 项目名称

The first Default default configuration
Manually select features custom configuration

? Please pick a preset: Manually select features
? Check the features needed for your project: Choose Vue version, Babel, Linter
? Choose a version of Vue.js that you want to start the project with 2.x
? Pick a linter / formatter config: Basic
? Pick additional lint features: Lint on save
? Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files
? Save this as a preset for future projects? No
$ cd kr
$ npm run serve

This step means the creation is successful! Just run the command

Two, elementUI component

1. Common layout

<template>
  <div class="about">
    <el-container>
      <el-header>Header</el-header>
      <el-container>
        <el-aside width="200px">Aside</el-aside>
        <el-main>Main</el-main>
      </el-container>
      <el-footer>Footer</el-footer>
    </el-container>
  </div>
</template>
<style>
.el-header,
.el-footer {
    
    
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
    
    
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
  height: 500px;
}

.el-main {
    
    
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body>.el-container {
    
    
  margin-bottom: 40px;
}
</style>

insert image description here

Guess you like

Origin blog.csdn.net/weixin_43778617/article/details/130681940