vue那些年踩過的坑

2021-10-07 19:21:26 字數 1792 閱讀 5070

那些年踩過的坑

module not found

module not found: error: can't resolve 'views/coverconfigurationrong' in 'd:\new-operation-admin\src\js\router'
原因:寫好路由之後,新建資料夾目錄,但是沒有給乙個帶export的入口(出口)檔案,於是找不到模組。

_.assign()_.assign(object, [sources]

const rst = await api.initdata(params)

console.log(json.stringify(rst))

// const res = rst.data.data

// let data

// error:_.assign(object, [sources]),

//需要宣告data是乙個物件!!!

let data = {}

_.assign(data,)

this.vos = data.vos

this.page.total = data.total

async await

const rst =  api.initdata(params)

console.log(rst)//undefined

//async 要宣告在離await最近的 作用域

v-if & v-for

正確寫法

el-table

el-column 元件裡的內容顯示不出來

//需要用上面的 包住

text-align只控制行內的對齊,不控制塊級元素自己

el-upload

image()

image()函式將會建立乙個新的例項相當於document.createelement(『img』)

vue.min.js:6 typeerror: cannot read property '_withtask' of undefined
@click 監聽的clic事件處理函式找不到

例如沒有宣告previewimg,報錯

return會停止函式,注意return的位置,免得提前退出了迴圈。

for迴圈注意邊界判定條件

typematch(row,type)

}},

怎麼在elment ui 元件的事件裡傳入自定義的屬性:

beforeupload(item.type,file)"

:on-success="imageuploadsuccess"

v-show="!hideshow(row,item.type)"

>

那些年踩過的CSS坑

1 img 標籤中的alt 與title的區別 title 滑鼠滑過時顯示的文字提示。對seo優化的影響 搜尋引擎對理解是通過alt屬性,所以在alt屬性中包含關鍵字的簡要文字說明,也是頁面優化的一部分。2 padding與margin區別 padding是控制項的內容相對控制項的邊緣的邊距,mar...

那些年之cordova踩過的坑

私人筆記 如果安裝的是crosswalk with cordova 整合版的話 新增外掛程式的方法是 需要的環境 nodejs git 1 npm安裝 plugman npm install g plugman2 cd到當前專案根目錄 cd f music3 安裝ngcordova外掛程式 這一步千...

uniapp之那些年踩過的坑

這裡我把一些坑列舉出來了?這裡有兩點 使用this.set obj key 值 或 者thi s.set obj,key,值 或者this.set ob j,ke y,值 或者th is.set array,index,值 像是處理vue底層監聽不到資料變化的解決方式 要用資料巢狀陣列,而不是物件包...