First, build the Vue development environment
vue Init webpack newmall
cnpm Install
npm Run Dev
Second, test static page
Copy the CSS in the static page
SRC directory to create Views folder, specifically placed pages.
First create a Goodslist page
Copy the static HTML in
Introducing CSS
Change route
At this point, the 8080 Port home page can display the product list
Attention:
When you introduce a path, you can
import goodslist from ' @/views/goodslist.vue '
@ defined location in build/webpack.base.conf
Here the picture resources in the root directory of static, and the location of the CSS static resources are not the same
Third, split components
Create a Compontents folder to place components specifically
Cut the header portion of the Goodslist page into the Navheader.vue file under Compontents
At this point the Goodslist page needs
1. Introduction of Navheader Components
2. Registering components
3. Using components
Iv. about Slots
A value in the Breadcrumb navigator is not fixed, so use the slot
Navbread page
Goodslist page
In this way, the goods is inserted into the specified slot.
Vue+node.js Study Notes