File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change 5151 slot(
5252 :name ="columnsItem.key + '-base-td'"
5353 :item ="dataItem"
54+ :rowIndex ="index"
5455 )
5556 span.c-table__expand ( v-if ="columnsItem.type === 'expand'" )
5657 c-icon( name ="chevron-down" v-if ="dataItem._showExpand" )
Original file line number Diff line number Diff line change @@ -193,7 +193,7 @@ export default {
193193 >
194194 <template slot =" opt-td" slot-scope =" props" >
195195 <div class =" c-table__opt" >
196- <a href =" javascript:;" @click =" showIp(props.item.ip )" > 查看ip
196+ <a href =" javascript:;" @click =" showIp(props)" > 查看ip
197197 </a >
198198 </div >
199199 </template >
@@ -246,8 +246,9 @@ export default {
246246 }
247247 },
248248 methods: {
249- showIp (ip ) {
250- alert (' ip 为 ' + ip)
249+ showIp (props ) {
250+ console .log (props)
251+ alert (' ip 为 ' + props .item .ip + ' 行号:' + props .rowIndex )
251252 },
252253 sorter (sortObj ) {
253254 this .sortKey = sortObj .key
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ mixin templateCell(columns)
66 slot-scope ="props"
77 v-if ="$scopedSlots[item.key+'-th']"
88 )
9- slot( :name ="item.key + '-th'" : item= "props" )
9+ slot( :name ="item.key + '-th'" : item= "props.item " )
1010 template(
1111 v-for ='item in ' + columns
1212 :slot ="item.key + '-base-td'"
1313 slot-scope ="props"
1414 v-if ="$scopedSlots[item.key+'-td']"
1515 )
16- slot( :name ="item.key + '-td'" : item= "props.item" )
16+ slot( :name ="item.key + '-td'" : item= "props.item" :rowIndex = "props.rowIndex" )
1717 template( slot ="expandRow" slot-scope ="props" )
1818 slot( name ="expand" : row= "props.row" )
1919mixin Table(columns, onlyhead, onlybody )
@@ -179,7 +179,7 @@ export default {
179179 watch: {
180180 datasource: {
181181 handler (newVal , oldVal ) {
182- if (newVal === oldVal ) return
182+ if (newVal === this . dataList ) return
183183 this .composeData ()
184184 this .getColumnsDetail ()
185185 this .$nextTick (_ => {
You can’t perform that action at this time.
0 commit comments