1.redirect & alias
redirect: 直接改變了url的值
alias: url沒有改變,只是改變了router-view中的內容
坑:不能再path爲’/’中配置alias
{
path: '/',
component: Hello,
alias: '/home'
}
無效!!!
2.computed VS methods
computed會緩存,值相關聯且發生改變纔會重新取值
methods總會重新取值計算
3.template模板加載異常
<template>
<div></div>
</template>
template模板裏要加元素包着,否則會報錯。