iView簡介
官網:http://v1.iviewui.com/
文檔:https://www.iviewui.com/docs/introduce
iView列表根據狀態渲染數據
在iView的列表顯示中,經常需要根據狀態來進行數據文本顯示。
columns: [
{
title: '課程類型',
key: 'courseType',
width: 100,
render:(h,params) => {
let texts = ''
if(params.row.publicLevel == 1){
texts = '實踐'
}else if(params.row.publicLevel == 2){
texts = '實驗'
}else if(params.row.publicLevel == 3){
texts = '實訓'
}
return h('div',{},texts)
}
}
]
效果如下圖: