您好,登錄后才能下訂單哦!
如何實(shí)現(xiàn)iview組件事件額外傳遞參數(shù)?相信很多沒(méi)有經(jīng)驗(yàn)的人對(duì)此束手無(wú)策,為此本文總結(jié)了問(wèn)題出現(xiàn)的原因和解決方法,通過(guò)這篇文章希望你能解決這個(gè)問(wèn)題。
<template> <Table border :columns="columns6" :data="data5" @on-row-click="(row, index) => { youFunc(row, index , 'params')}"></Table> </template> <script> export default { methods:{ youFunc(row, index, params) { console.log(row, index, params) } }, data () { return { columns6: [ { title: 'Date', key: 'date' }, { title: 'Name', key: 'name' }, { title: 'Age', key: 'age', filters: [ { label: 'Greater than 25', value: 1 }, { label: 'Less than 25', value: 2 } ], filterMultiple: false, filterMethod (value, row) { if (value === 1) { return row.age > 25; } else if (value === 2) { return row.age < 25; } } }, { title: 'Address', key: 'address', filters: [ { label: 'New York', value: 'New York' }, { label: 'London', value: 'London' }, { label: 'Sydney', value: 'Sydney' } ], filterMethod (value, row) { return row.address.indexOf(value) > -1; } } ], data5: [ { name: 'John Brown', age: 18, address: 'New York No. 1 Lake Park', date: '2016-10-03' }, { name: 'Jim Green', age: 24, address: 'London No. 1 Lake Park', date: '2016-10-01' }, { name: 'Joe Black', age: 30, address: 'Sydney No. 1 Lake Park', date: '2016-10-02' }, { name: 'Jon Snow', age: 26, address: 'Ottawa No. 2 Lake Park', date: '2016-10-04' } ], } } } </script>
看完上述內(nèi)容,你們掌握如何實(shí)現(xiàn)iview組件事件額外傳遞參數(shù)的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。