vue04 summary

"" "
1, ambient
node: official website to download the installation package, fool installation - https://nodejs.org/zh-cn/ => comes in accordance with the npm
CNPM: npm install -g CNPM --registry = HTTPS: // registry.npm.taobao.org
VUE / cli: CNPM install -g @ VUE / cli

2. Create a project
directory cd storage project
vue create project name => babel components need to be installed, vue-router, vuex

3, configure the project started
pycharm open project, configuration npm start

4, main.js complete loading vue environment, finished rendering the root component, loading vue-router, vuex environmental load customized environment

5, vue-router configuration route:
|. This $ router.push () to complete the jump
Complete page component placeholder
to complete the route in the router / index.js configured path - a view component mapping between
two routing pass parameters
to configure Jump acquisition
path: '/ user' to = "/ user pk = 1?" $ Route. query.pk
path: '/ User /: PK' to = "/ User /. 1" $ route.params.pk

:to="{name: 'user'}"

6, the hook component life cycle: assembly from creation to destroy the entire life cycle of the method in a specific callback time node
created () {background data to complete the requested}
Mounted () {extremely time-consuming to complete the requested data back}

7, js prototype
Vue.prototype.count = 100
all Vue instances can access COUNT
"" "

Guess you like

Origin www.cnblogs.com/zhangchaocoming/p/12081870.html