- import()方法中灵妨,不能使用模板字符串,若需要使用變量,需采用字符串拼接形式:
const importPage = page => {
return () => import('../views/' + page)
}
- formData里面的數(shù)據(jù)是打印不出來的乍迄,需要formData.get('name')。
- axios請(qǐng)求的時(shí)候若是400士败,先檢查一下headers是不是
application/x-www-form-urlencoded
闯两,是的話需要用qs.stringfy轉(zhuǎn)成表單數(shù)據(jù)。 - element
drawer
組件點(diǎn)擊有黑框:
/deep/ .el-drawer:focus {
outline: none;
}
/deep/ .el-drawer__header > span:focus {
outline: none;
}
5.jsx自定義element 的table組件的坑
獲取table當(dāng)前行的數(shù)據(jù):
<el-table-column
key={item.prop}
{...{ attrs: item }}
{...{
scopedSlots: {
default: scope => {
console.log('scope', scope)
return this.$scopedSlots[item.slot]({
data: scope.row
})
}
}
}}
>
</el-table-column>
6.父子組件維護(hù)數(shù)據(jù)谅将,不要維護(hù)兩套數(shù)據(jù)(即父組件一套漾狼,子組件一套),容易造成bug的產(chǎn)生饥臂,應(yīng)使用單一數(shù)據(jù)流模式逊躁,即數(shù)據(jù)應(yīng)該始終在父組件維護(hù)