当前位置:网站首页>[hungry dynamic table]
[hungry dynamic table]
2022-07-05 09:28:00 【Guodong pudding】
<template>
<div>
<el-button @click="add"> Add a new line </el-button>
<el-button @click="save"> preservation </el-button>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="compty" label=" date " width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.compty" placeholder=" Please enter the content "></el-input>
</template>
</el-table-column>
<el-table-column prop="brand" label=" full name " width="180">
<template slot-scope="scope">
<el-select v-model="scope.row.brand" placeholder=" Please select ">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label=" date " width="180">
<template slot-scope="scope">
<el-button
@click.native.prevent="deleteRow(scope.$index, tableData)"
type="text"
size="small">
remove
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
data() {
return {
compty: null,
tableData: [
// {
// date: '2016-05-02',
// name: ' X.h. ',
// address: ' Jinshajiang road, putuo district, Shanghai 1518 get '
// }, {
// date: '2016-05-04',
// name: ' X.h. ',
// address: ' Jinshajiang road, putuo district, Shanghai 1517 get '
// }, {
// date: '2016-05-01',
// name: ' X.h. ',
// address: ' Jinshajiang road, putuo district, Shanghai 1519 get '
// }, {
// date: '2016-05-03',
// name: ' X.h. ',
// address: ' Jinshajiang road, putuo district, Shanghai 1516 get '
// }
],
options: [{
value: ' Options 1',
label: ' Golden cake '
}, {
value: ' Options 2',
label: ' Double skin milk '
}, {
value: ' Options 3',
label: ' Oyster omelet '
}, {
value: ' Options 4',
label: ' dragon whiskers noodles '
}, {
value: ' Options 5',
label: ' Beijing Roast Duck '
}],
}
},
created() {
},
methods: {
add() {
this.tableData.push({
compty: null,
brand: null,
})
},
save() {
console.log(' Saved data ',this.tableData);
},
deleteRow(index,row) {
console.log('index',index);
console.log('row',row);
console.log(this.tableData);
this.tableData.splice(index,1)
}
},
}
</script>
边栏推荐
- NIPS2021 | 超越GraphCL,GNN+对比学习的节点分类新SOTA
- Creation and reference of applet
- 【阅读笔记】图对比学习 GNN+CL
- Kotlin introductory notes (VIII) collection and traversal
- Svg optimization by svgo
- Lepton 无损压缩原理及性能分析
- Hosting environment API
- Priority queue (heap)
- 一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
- Kotlin introductory notes (III) kotlin program logic control (if, when)
猜你喜欢
A keepalived high availability accident made me learn it again
c语言指针深入理解
Unity SKFramework框架(二十四)、Avatar Controller 第三人称控制
Unity skframework framework (XXIII), minimap small map tool
OpenGL - Lighting
[technical school] spatial accuracy of binocular stereo vision system: accurate quantitative analysis
[ctfhub] Title cookie:hello guest only admin can get flag. (cookie spoofing, authentication, forgery)
Information and entropy, all you want to know is here
Kotlin introductory notes (VIII) collection and traversal
一次 Keepalived 高可用的事故,让我重学了一遍它
随机推荐
22-07-04 Xi'an Shanghao housing project experience summary (01)
Principle and performance analysis of lepton lossless compression
【对象数组a与对象数组b取出id不同元素赋值给新的数组】
Alibaba's ten-year test brings you into the world of APP testing
【饿了么动态表格】
c语言指针深入理解
SMT32H7系列DMA和DMAMUX的一点理解
[reading notes] Figure comparative learning gnn+cl
[beauty of algebra] singular value decomposition (SVD) and its application to linear least squares solution ax=b
Nodejs modularization
Lepton 无损压缩原理及性能分析
Kotlin introductory notes (III) kotlin program logic control (if, when)
高性能Spark_transformation性能
Lepton 无损压缩原理及性能分析
High performance spark_ Transformation performance
Composition of applet code
Creation and reference of applet
太不好用了,长文章加图文,今后只写小短文
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
Newton iterative method (solving nonlinear equations)