You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

52 lines
1.2 KiB

<template>
<el-table
ref="guiptable"
:data="tableData"
height="250"
:border="border"
@selection-change="handleSelectionChange"
:style="{width: width? width :'100%'}">
<!-- 多选 -->
<template v-if="multiple">
<el-table-column
type="selection"
width="55">
</el-table-column>
</template>
<!-- 自定义header -->
<template v-if="autoColumn">
<slot name="header"></slot>
</template>
<!-- 通过json数据遍历渲染 -->
<template v-if="columns">
<el-table-column
v-for="column in columns"
:key="column.prop"
:prop="column.prop"
:label="column.label"
:width="column.width">
</el-table-column>
</template>
</el-table>
</template>
<script>
export default {
name: 'GuipTextarea',
props:['tableData','width','autoColumn','columns','border','multiple'],
data() {
return {
}
},
methods:{
handleSelectionChange(row){
// 获取的当前行信息
console.log(row,'======');
this.$emit('selectChange',row)
}
}
}
</script>