example I don"t understand. Is scope the default binding list?
how can row get the current line automatically?
do not understand the principle of it
<template>
<el-table
:data="tableData4"
style="width: 100%"
max-height="250">
<el-table-column
fixed
prop="date"
label=""
width="150">
</el-table-column>
<el-table-column
prop="name"
label=""
width="120">
</el-table-column>
<el-table-column
prop="province"
label=""
width="120">
</el-table-column>
<el-table-column
prop="city"
label=""
width="120">
</el-table-column>
<el-table-column
prop="address"
label=""
width="300">
</el-table-column>
<el-table-column
prop="zip"
label=""
width="120">
</el-table-column>
<el-table-column
fixed="right"
label=""
width="120">
<template slot-scope="scope">
<el-button
@click.native.prevent="deleteRow(scope.$index, tableData4)"
type="text"
size="small">
</el-button>
</template>
</el-table-column>
</el-table>
</template>
<script>
export default {
methods: {
deleteRow(index, rows) {
rows.splice(index, 1);
}
},
data() {
return {
tableData4: [{
date: "2016-05-03",
name: "",
province: "",
city: "",
address: " 1518 ",
zip: 200333
}, {
date: "2016-05-02",
name: "",
province: "",
city: "",
address: " 1518 ",
zip: 200333
}, {
date: "2016-05-04",
name: "",
province: "",
city: "",
address: " 1518 ",
zip: 200333
}, {
date: "2016-05-01",
name: "",
province: "",
city: "",
address: " 1518 ",
zip: 200333
}, {
date: "2016-05-08",
name: "",
province: "",
city: "",
address: " 1518 ",
zip: 200333
}, {
date: "2016-05-06",
name: "",
province: "",
city: "",
address: " 1518 ",
zip: 200333
}, {
date: "2016-05-07",
name: "",
province: "",
city: "",
address: " 1518 ",
zip: 200333
}]
}
}
}
</script>
< hr >
solve the transfer of this code
<div class="div-tab">
<el-table :data="bankLists" >
<el-table-column prop="index" label="index" type="index" :index="indexMethod">
</el-table-column>
<el-table-column prop="id" label="">
</el-table-column>
<el-table-column prop="interfaceNo" label="">
</el-table-column>
<el-table-column prop="remarks" label="">
</el-table-column>
<el-table-column prop="writer" label="">
</el-table-column>
<el-table-column prop="createDate" label="">
</el-table-column>
<el-table-column prop="modifyDate" label="">
</el-table-column>
<el-table-column prop="send" label="">
</el-table-column>
<el-table-column prop="receive" label="">
</el-table-column>
<el-table-column label="" width="100px">
<template scope="scope">
<el-button size="small" type="primary" icon="el-icon-edit" @click="bank_mapping_edit(scope.row)"></el-button>
<el-button size="small" type="danger" icon="el-icon-delete" @click="bank_mapping_del(scope.row)"></el-button>
</template>
</el-table-column>
</el-table>
</div>