当前位置:网站首页>【饿了么动态表格】
【饿了么动态表格】
2022-07-05 09:27:00 【果东布丁】
<template>
<div>
<el-button @click="add">新增一行</el-button>
<el-button @click="save">保存</el-button>
<el-table :data="tableData" style="width: 100%">
<el-table-column prop="compty" label="日期" width="180">
<template slot-scope="scope">
<el-input v-model="scope.row.compty" placeholder="请输入内容"></el-input>
</template>
</el-table-column>
<el-table-column prop="brand" label="姓名" width="180">
<template slot-scope="scope">
<el-select v-model="scope.row.brand" placeholder="请选择">
<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="日期" width="180">
<template slot-scope="scope">
<el-button
@click.native.prevent="deleteRow(scope.$index, tableData)"
type="text"
size="small">
移除
</el-button>
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
data() {
return {
compty: null,
tableData: [
// {
// date: '2016-05-02',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1518 弄'
// }, {
// date: '2016-05-04',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1517 弄'
// }, {
// date: '2016-05-01',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1519 弄'
// }, {
// date: '2016-05-03',
// name: '王小虎',
// address: '上海市普陀区金沙江路 1516 弄'
// }
],
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
}
},
created() {
},
methods: {
add() {
this.tableData.push({
compty: null,
brand: null,
})
},
save() {
console.log('保存的数据',this.tableData);
},
deleteRow(index,row) {
console.log('index',index);
console.log('row',row);
console.log(this.tableData);
this.tableData.splice(index,1)
}
},
}
</script>
边栏推荐
- nodejs_ fs. writeFile
- Understanding rotation matrix R from the perspective of base transformation
- 顶会论文看图对比学习(GNN+CL)研究趋势
- Applet network data request
- 测试老鸟浅谈unittest和pytest的区别
- Jenkins Pipeline 方法(函数)定义及调用
- 3D reconstruction open source code summary [keep updated]
- OpenGL - Lighting
- [beauty of algebra] solution method of linear equations ax=0
- Android 隐私沙盒开发者预览版 3: 隐私安全和个性化体验全都要
猜你喜欢
![[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization](/img/54/cb1373fbe7b21c5383580e8b638a2c.jpg)
[code practice] [stereo matching series] Classic ad census: (6) multi step parallax optimization

Nodemon installation and use

利用请求头开发多端应用

LeetCode 31. 下一个排列

Shutter uses overlay to realize global pop-up

OpenGL - Coordinate Systems
![[beauty of algebra] singular value decomposition (SVD) and its application to linear least squares solution ax=b](/img/ee/8e07e2dd89bed63ff44400fe1864a9.jpg)
[beauty of algebra] singular value decomposition (SVD) and its application to linear least squares solution ax=b

22-07-04 Xi'an Shanghao housing project experience summary (01)

OpenGL - Lighting

Can't find the activitymainbinding class? The pit I stepped on when I just learned databinding
随机推荐
C # draw Bezier curve with control points for lattice images and vector graphics
np. allclose
fs. Path module
Generate confrontation network
Analysis of eventbus source code
一篇文章带你走进cookie,session,Token的世界
[code practice] [stereo matching series] Classic ad census: (5) scan line optimization
Multiple solutions to one problem, asp Net core application startup initialization n schemes [Part 1]
AUTOSAR from getting started to mastering 100 lectures (103) -dbc file format and creation details
[team PK competition] the task of this week has been opened | question answering challenge to consolidate the knowledge of commodity details
Rebuild my 3D world [open source] [serialization-3] [comparison between colmap and openmvg]
一题多解,ASP.NET Core应用启动初始化的N种方案[上篇]
3D reconstruction open source code summary [keep updated]
【PyTorch Bug】RuntimeError: Boolean value of Tensor with more than one value is ambiguous
Unity skframework framework (XXIII), minimap small map tool
迁移学习和域自适应
Hosting environment API
Unity skframework framework (XXII), runtime console runtime debugging tool
Kotlin introductory notes (VII) data class and singleton class
Introduction Guide to stereo vision (1): coordinate system and camera parameters