Create VUE project + Hbuilder

1. cmd command line to create a project

vue init webpack stuvue
npm i -g @vue/cli-init

.Verify whether the creation was successful

 2. Open the project and run:

cd +项目名
npm run dev

 

Enter the URL on the web page, and the following image will be displayed, and it will be successful

3. Drag the items in the folder into Hbuilder

 4. Install Element

npm i element-ui -S

5. Introduce Element in the main.js of the VUE project


import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';

Vue.use(ElementUI);

6. Install axios

Introduced in main.js:

import axios from 'axios'
Vue.prototype.$axios = axios    //全局注册,使用方法为:this.$axios

7. Introduce the table component in the element web page

In the components directory, create a new vue file and copy the code into it.

Change the routing path in the router directory

Guess you like

Origin blog.csdn.net/weixin_44198288/article/details/130561037