在线观看不卡亚洲电影_亚洲妓女99综合网_91青青青亚洲娱乐在线观看_日韩无码高清综合久久

鍍金池/ 問(wèn)答/HTML/ iview,table組件怎么用代碼設(shè)置當(dāng)前選中行

iview,table組件怎么用代碼設(shè)置當(dāng)前選中行

iview,table組件怎么用代碼設(shè)置當(dāng)前選中行

回答
編輯回答
神曲

1.鼠標(biāo)點(diǎn)擊選中
Table props:
highlight-row 是否支持高亮選中的行,即單選 Boolean false;

<Table highlight-row :columns="columns" :data="data1"></Table>

2.指定某行,或多行顯示
Table props:
row-class-name 行的 className 的回調(diào)方法,傳入?yún)?shù):row:當(dāng)前行數(shù)據(jù)index:當(dāng)前行的索引 Function -

<Table :row-class-name="rowClassName" :columns="columns" :data="data"></Table>
methods: {
    rowClassName (row, index) {
        if (index === 1) {
            return 'demo-table-info-row'; // 樣式名
        } else if (index === 3) {
            return 'demo-table-error-row'; // 樣式名
        }
        return '';
    }
}
2017年9月23日 09:29
編輯回答
何蘇葉

不要用他默認(rèn)table的selection,自己生成復(fù)選框,自己做選中,iview自己的多選有點(diǎn)雞肋

2018年6月24日 17:58